You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Okomin (JIRA)" <ji...@apache.org> on 2006/12/26 11:55:21 UTC

[jira] Created: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

[classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
---------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2875
                 URL: http://issues.apache.org/jira/browse/HARMONY-2875
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ilya Okomin
            Priority: Minor


According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)

"An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."

a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.

b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.

Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
------------- test.java --------------
import java.awt.Point;
import java.awt.image.BandedSampleModel;
import java.awt.image.DataBufferByte;
import java.awt.image.Raster;

import junit.framework.TestCase;
import junit.textui.TestRunner;

public class test extends TestCase {

    public static void main(String args[]) {
        TestRunner.run(test.class);
    }

    public void testCase1() {

        Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
                new DataBufferByte(new byte[191], 0), 
                new Point(new Point(28, 43)));
        try {
            rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
            fail("ArrayIndexOutOfBoundsException should be thrown");
        } catch (ArrayIndexOutOfBoundsException e) {
            //expected
        }

    }

    public void testCase2() {

        Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
                new DataBufferByte(new byte[191], 0), 
                new Point(new Point(28,43)));
        rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
    }

    public void testCase3() {

        Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
                new DataBufferByte(new byte[191], 0), new Point(new Point(28,
                        43)));
        rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
    }
}

----------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrey Pavlenko updated HARMONY-2875:
-------------------------------------

    Attachment: HARMONY-2875-RasterTest.patch
                HARMONY-2875-BandedSampleModel.patch

I've attached the patch for the first test case. In the 2d and 3d cases I think Harmony follows the spec.

> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-2875:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477960 ] 

Andrey Pavlenko commented on HARMONY-2875:
------------------------------------------

Verified. You can close the issue. Thanks.

> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko resolved HARMONY-2875.
--------------------------------------

    Resolution: Fixed

Since we do not need to override getPixels method in BandedSampleModel class I've just removed it.
Test patch has been applied without changes.

Andrey, please verify that everything works as you expected.

> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470968 ] 

Andrey Pavlenko commented on HARMONY-2875:
------------------------------------------

This patch replaces the implementation of the BandedSampleModel.getPixels() method with a call to the inherited method, which is identical to this method but performs boundary checking.

> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko closed HARMONY-2875.
------------------------------------


> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov updated HARMONY-2875:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2875
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2875
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch
>
>
> According to the specification for getPixels(int x,int y, int w, int h,  int/float/double[] array)
> "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed."
> a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does.
> b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not.
> Run next Test case to reproduce, it fails on Harmony and successfully passes on RI:
> ------------- test.java --------------
> import java.awt.Point;
> import java.awt.image.BandedSampleModel;
> import java.awt.image.DataBufferByte;
> import java.awt.image.Raster;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testCase1() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28, 43)));
>         try {
>             rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {});
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected
>         }
>     }
>     public void testCase2() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), 
>                 new Point(new Point(28,43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {});
>     }
>     public void testCase3() {
>         Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4),
>                 new DataBufferByte(new byte[191], 0), new Point(new Point(28,
>                         43)));
>         rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {});
>     }
> }
> ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.