You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2007/01/11 18:57:27 UTC

[jira] Resolved: (HARMONY-2783) [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getPixels(int,int,inrt,int,int[],DataBuffer) does not throw ArrayIndexOutOfBoundsException while RI throws it

     [ https://issues.apache.org/jira/browse/HARMONY-2783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov resolved HARMONY-2783.
--------------------------------------

    Resolution: Fixed

Oleg and Alexander,  thanks, the patch was applied at the revision r495310.  Please verify that it was applied as expected.

> [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getPixels(int,int,inrt,int,int[],DataBuffer) does not throw ArrayIndexOutOfBoundsException while RI throws it
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2783
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2783
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Oleg Khaschansky
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: ComponentSampleModel2783.patch, ComponentSampleModel2783Test.patch
>
>
> The behavior of Harmony implementation of the constructor ComponentSampleModel.getPixels(int,int,inrt,int,int[],DataBuffer) differs from RI in case of integer overflow. The following testcase demostrates this difference:
> --------------------------------------------------------------------------------------------------
> import junit.framework.TestCase;
> import java.awt.image.ComponentSampleModel;
> import java.awt.image.DataBufferInt;
> public class Test0 extends TestCase {
>     public void testcase0(){
>         ComponentSampleModel csm = new ComponentSampleModel(0, 10, 10, 1, 10, new int[]{0});
>         DataBufferInt dbi = new DataBufferInt(100);
>         try {
>             int[] returnValue = csm.getPixels(8, Integer.MAX_VALUE, 1, 1, (int[])null, dbi);
>             fail("Exception expected");
>         } catch(ArrayIndexOutOfBoundsException expectedException) {
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> --------------------------------------------------------------------------------------------------
> Harmony:
> junit.framework.AssertionFailedError: Exception expected
> 	at Test0.testcase0(Test0.java:32)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> RI:
> java.lang.ArrayIndexOutOfBoundsException: -2 was thrown

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