harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2783) [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getPixels(int,int,inrt,int,int[],DataBuffer) does not throw ArrayIndexOutOfBoundsException while RI throws it
Date Thu, 21 Dec 2006 10:14:22 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2783?page=all ]

Alexei Zakharov updated HARMONY-2783:
-------------------------------------

    Patch Info: [Patch Available]

> [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: http://issues.apache.org/jira/browse/HARMONY-2783
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Oleg Khaschansky
>            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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message