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-2801) [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer) does not throw NPE while RI does
Date Tue, 19 Dec 2006 16:40:21 GMT
[classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2801
                 URL: http://issues.apache.org/jira/browse/HARMONY-2801
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Oleg Khaschansky
            Priority: Trivial


Under some specific circumstances java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE on Harmony, but RI does. This is a case when integer overflow occurs with
the passed coordinates/width/height values. NPE is not documented in the API spec. I don't
think that this is a big issue and suggest to treat this as a non-bug difference from RI.
The following testcase demonstrates this behavior:
------------------------------------------------------------------------------------------
import junit.framework.TestCase;

import java.awt.image.*;

public class Test0 extends TestCase {
    public void testcase0() {
        ComponentSampleModel csm = new ComponentSampleModel(3, 10, 10, 1, 10, new int[]{0});

        try {
            int[] returnValue =
                    csm.getSamples(Integer.MAX_VALUE,4,1,1,0,new int[]{0},(DataBuffer) null);
            fail("No exception");
        } catch(NullPointerException expectedException) {
            System.out.println(expectedException +" was thrown");
        }
    }
}
------------------------------------------------------------------------------------------
Harmony:
No exception

junit.framework.AssertionFailedError
	at Test0.testcase0(Test0.java:33)
	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
------------------------------------------------------------------------------------------
RI:
java.lang.NullPointerException 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