This patch (committed) fixes the remaining failing Mauve test cases for this 
class:

2006-07-26  David Gilbert  <[EMAIL PROTECTED]>

        * java/awt/image/BandedSampleModel.java
        (getDataElements): Check for negative x or y,
        (getPixels): Likewise,
        (getSamples): Likewise,
        (setSamples): Likewise.

Regards,

Dave
Index: java/awt/image/BandedSampleModel.java
===================================================================
RCS file: /sources/classpath/classpath/java/awt/image/BandedSampleModel.java,v
retrieving revision 1.9
diff -u -r1.9 BandedSampleModel.java
--- java/awt/image/BandedSampleModel.java       26 Jul 2006 06:27:28 -0000      
1.9
+++ java/awt/image/BandedSampleModel.java       26 Jul 2006 13:02:19 -0000
@@ -192,6 +192,9 @@
    */
   public Object getDataElements(int x, int y, Object obj, DataBuffer data)
   {
+    if (x < 0 || y < 0)
+      throw new ArrayIndexOutOfBoundsException(
+          "x and y must not be less than 0.");
     int pixel = getSample(x, y, 0, data);
     switch (getTransferType())
     {
@@ -294,6 +297,9 @@
   public int[] getPixels(int x, int y, int w, int h, int[] iArray,
                         DataBuffer data)
   {
+    if (x < 0 || y < 0)
+      throw new ArrayIndexOutOfBoundsException(
+          "x and y must not be less than 0.");
     if (iArray == null) 
       iArray = new int[w * h * numBands];
     int outOffset = 0;
@@ -401,6 +407,9 @@
   public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray,
                          DataBuffer data)
   {
+    if (x < 0 || y < 0)
+      throw new ArrayIndexOutOfBoundsException(
+          "x and y must not be less than 0.");
     if (iArray == null) 
       iArray = new int[w * h];
     int outOffset = 0;
@@ -640,6 +649,9 @@
   public void setSamples(int x, int y, int w, int h, int b, int[] iArray,
                         DataBuffer data)
   {
+    if (x < 0 || y < 0)
+      throw new ArrayIndexOutOfBoundsException(
+          "x and y must not be less than 0.");
     int inOffset = 0;
 
     switch (getTransferType())

Reply via email to