harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Khaschansky (JIRA)" <j...@apache.org>
Subject [jira] Created: (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 Mon, 18 Dec 2006 16:28:21 GMT
[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


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