Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8265647

DataBufferUShort constructors check 'dataArray' for 'null' after dereference

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 16, 17
    • client-libs

      Two constructors of class 'java.awt.image.DataBufferUShort' contain null check of 'dataArray' after dereference it:

      public DataBufferUShort(short[][] dataArray, int size) {
          super(UNTRACKABLE, TYPE_USHORT, size, dataArray.length);
          if (dataArray == null) {
              throw new NullPointerException("dataArray is null");
          }

      public DataBufferUShort(short[][] dataArray, int size, int[] offsets) {
          super(UNTRACKABLE, TYPE_USHORT, size, dataArray.length, offsets);
          if (dataArray == null) {
              throw new NullPointerException("dataArray is null");
          }


      As code already throw NPE when null is passed we can remove redundant {{if}} statement.

            Unassigned Unassigned
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: