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] Closed: (HARMONY-2801) [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer) does not throw NPE while RI does
Date Mon, 15 Jan 2007 18:14:27 GMT

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

Alexei Zakharov closed HARMONY-2801.
------------------------------------


verified by Alexander

> [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: https://issues.apache.org/jira/browse/HARMONY-2801
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Oleg Khaschansky
>         Assigned To: Alexei Zakharov
>            Priority: Trivial
>         Attachments: ComponentSampleModel2783Test.patch, ComponentSampleModel2801.patch,
ComponentSampleModel2801Test.patch
>
>
> 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message