-
Bug
-
Resolution: Unresolved
-
P5
-
20
-
None
There is a null check of parameter 'bandOffsets' in the method 'java.awt.image.Raster#createBandedRaster(int, int, int, int, int[], int[], java.awt.Point)'
https://github.com/openjdk/jdk/blob/ab06a878f888827026424530781f0af414a8a611/src/java.desktop/share/classes/java/awt/image/Raster.java#L441
But just a few lines above there is a statement which dereferences this 'bandOffset'
int bands = bandOffsets.length;
...
if (bandOffsets == null) {
throw new
ArrayIndexOutOfBoundsException("Band offsets array is null");
}
It means we can safely remove this 'if'. NPE will be throw by JVM if parameter is null.
https://github.com/openjdk/jdk/blob/ab06a878f888827026424530781f0af414a8a611/src/java.desktop/share/classes/java/awt/image/Raster.java#L441
But just a few lines above there is a statement which dereferences this 'bandOffset'
int bands = bandOffsets.length;
...
if (bandOffsets == null) {
throw new
ArrayIndexOutOfBoundsException("Band offsets array is null");
}
It means we can safely remove this 'if'. NPE will be throw by JVM if parameter is null.