-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P5
-
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.
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.