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/15 11:24:27 UTC
[jira] Resolved: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov resolved HARMONY-2801.
--------------------------------------
Resolution: Fixed
Thanks guys, the patch was applied at the revision r496267. Please verify.
> [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
>
>
> 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