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

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P5
    • tbd
    • Affects Version/s: 16, 17
    • Component/s: 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.

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

              Created:
              Updated: