You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Oleg Khaschansky (JIRA)" <ji...@apache.org> on 2006/12/19 17:40:21 UTC
[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
[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
[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
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ 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
[jira] Updated: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander D Shipilov updated HARMONY-2801:
------------------------------------------
Attachment: ComponentSampleModel2783Test.patch
> [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
> 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
[jira] Assigned: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov reassigned HARMONY-2801:
----------------------------------------
Assignee: Alexei Zakharov
> [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
[jira] Updated: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov updated HARMONY-2801:
-------------------------------------
Patch Info: [Patch Available]
> [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
> 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
[jira] Updated: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander D Shipilov updated HARMONY-2801:
------------------------------------------
Attachment: ComponentSampleModel2801Test.patch
> [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
[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
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ 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
[jira] Commented: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464898 ]
Alexander D Shipilov commented on HARMONY-2801:
-----------------------------------------------
Yes, your test case is ok.
Thanks.
> [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
[jira] Updated: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander D Shipilov updated HARMONY-2801:
------------------------------------------
Attachment: ComponentSampleModel2801.patch
> [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
> 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
[jira] Commented: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464683 ]
Alexei Zakharov commented on HARMONY-2801:
------------------------------------------
Alexander, it seems that the test case you 've attached is for another JIRA (2783 I guess)
> [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
[jira] Commented: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464753 ]
Alexander D Shipilov commented on HARMONY-2801:
-----------------------------------------------
Alexei, you are right it is :)
I had attache correct test case.
Thank you.
> [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
[jira] Commented: (HARMONY-2801) [classlib][awt] Compatibility:
java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer)
does not throw NPE while RI does
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464840 ]
Alexei Zakharov commented on HARMONY-2801:
------------------------------------------
I took the testcase from the bug description and committed it. 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, 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