-
Bug
-
Resolution: Fixed
-
P2
-
6, 7
-
b116
-
generic
-
generic, solaris
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185276 | 6-pool | Andrew Brygin | P3 | Closed | Other |
The spec for java.awt.image.SampleModel.getDataElements() says:
"@throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds, or if obj is too small to hold the output."
This exception is not thrown in all those cases. Please see the following code sample:
---
import java.awt.image.*;
public class Extract {
public static void main(String[] args) {
SampleModel model = Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 10, 4, null).getSampleModel();
DataBuffer data = model.createDataBuffer();
// No expected ArrayIndexOutOfBoundsException
model.getDataElements(Integer.MAX_VALUE, 0, 1, 1, null, data);
model.getDataElements(0, Integer.MAX_VALUE, 1, 1, null, data);
}
}
---
This problems leads to failing JCK test:
api/java_awt/Image/SampleModel/index.html#GetsetDataElements2[getsetDataElements20004]
Platforms: Windows, Solaris
JDK: 6, 7
"@throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds, or if obj is too small to hold the output."
This exception is not thrown in all those cases. Please see the following code sample:
---
import java.awt.image.*;
public class Extract {
public static void main(String[] args) {
SampleModel model = Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 10, 4, null).getSampleModel();
DataBuffer data = model.createDataBuffer();
// No expected ArrayIndexOutOfBoundsException
model.getDataElements(Integer.MAX_VALUE, 0, 1, 1, null, data);
model.getDataElements(0, Integer.MAX_VALUE, 1, 1, null, data);
}
}
---
This problems leads to failing JCK test:
api/java_awt/Image/SampleModel/index.html#GetsetDataElements2[getsetDataElements20004]
Platforms: Windows, Solaris
JDK: 6, 7
- backported by
-
JDK-2185276 java.awt.image.SampleModel.getDataElements() does't throw ArrayIndexOutOfBoundsEx for Integer.MAX_V
-
- Closed
-
- relates to
-
JDK-6735275 java.awt.image.SampleModel.getSamples() methods not allways throw ArrayIndexOutOfBoundsException
-
- Closed
-
-
JDK-7030147 java.awt.image.SampleModel.setDataElements() does't throw ArrayIndexOutOfBoundsEx for Integer.MAX_VA
-
- Closed
-