This patch (committed) fixes a failing Mauve test:
2006-07-20 David Gilbert <[EMAIL PROTECTED]>
* java/awt/image/ComponentSampleModel.java
(getPixel): Added argument check,
(getSample): Modified exception message.
Regards,
Dave
Index: java/awt/image/ComponentSampleModel.java
===================================================================
RCS file:
/sources/classpath/classpath/java/awt/image/ComponentSampleModel.java,v
retrieving revision 1.15
diff -u -r1.15 ComponentSampleModel.java
--- java/awt/image/ComponentSampleModel.java 18 Jul 2006 16:36:30 -0000
1.15
+++ java/awt/image/ComponentSampleModel.java 20 Jul 2006 08:42:59 -0000
@@ -676,6 +676,9 @@
*/
public int[] getPixel(int x, int y, int[] iArray, DataBuffer data)
{
+ if (x < 0 || x >= width || y < 0 || y >= height)
+ throw new ArrayIndexOutOfBoundsException("Pixel (" + x + ", " + y
+ + ") is out of bounds.");
int offset = pixelStride * x + scanlineStride * y;
if (iArray == null)
iArray = new int[numBands];
@@ -742,7 +745,8 @@
public int getSample(int x, int y, int b, DataBuffer data)
{
if (x < 0 || x >= width || y < 0 || y >= height)
- throw new ArrayIndexOutOfBoundsException("(x, y) is out of bounds.");
+ throw new ArrayIndexOutOfBoundsException("Sample (" + x + ", " + y
+ + ") is out of bounds.");
return data.getElem(bankIndices[b], getOffset(x, y, b));
}