-
Bug
-
Resolution: Unresolved
-
P5
-
16, 17
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.
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.