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/30 16:04:33 UTC
[jira] Resolved: (HARMONY-2431) [classlib][awt]
SinglePixelPackedSampleModel.getSamples() expected
ArrayIndexOutOfBoundsException
[ https://issues.apache.org/jira/browse/HARMONY-2431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov resolved HARMONY-2431.
--------------------------------------
Resolution: Fixed
Assignee: Alexei Zakharov
Thanks, patches were applied at the revision 501410. Please verify.
> [classlib][awt] SinglePixelPackedSampleModel.getSamples() expected ArrayIndexOutOfBoundsException
> -------------------------------------------------------------------------------------------------
>
> Key: HARMONY-2431
> URL: https://issues.apache.org/jira/browse/HARMONY-2431
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Alexei Zakharov
> Attachments: SinglePixelPackedSampleModel.patch, SinglePixelPackedSampleModelTest.patch
>
>
> According to the specification for getSamples(int x,
> int y,
> int w,
> int h,
> int b,
> int[] iArray,
> DataBuffer data)
> ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.
> Harmony does not throw ArrayIndexOutOfBoundsException if some int argument equals Integer.MAX_VALUE while RI does. The same problem is for setPixels(int x,
> int y,
> int w,
> int h,
> int[] iArray,
> DataBuffer data) method.
> import java.awt.image.*;
> import junit.framework.TestCase;
> import java.awt.*;
> public class test extends TestCase {
> public void testcase1() {
> SinglePixelPackedSampleModel model = new SinglePixelPackedSampleModel(3,216,1,new int[851]);
> model.getSamples(
> 6,7,14,Integer.MAX_VALUE,0,
> new int[] { 0,0,0},
> new DataBufferDouble(7,5));
> }
> public void testcase2() {
> SinglePixelPackedSampleModel model = new SinglePixelPackedSampleModel(1,127,3,0,new int[970]);
> model.setPixels(
> Integer.MAX_VALUE,1,13,1,
> new int[] {},
> new DataBufferDouble(7,5));
> }
> }
> Output on Sun 1.5
> =================
> .E.E
> Time: 0,016
> There were 2 errors:
> 1) testcase1(test)java.lang.ArrayIndexOutOfBoundsException: 1518
> at java.awt.image.DataBufferDouble.getElem(DataBufferDouble.java:166)
> at
> java.awt.image.SinglePixelPackedSampleModel.getSamples(SinglePixelPackedSampleModel.java:542)
> at test.testcase1(test.java:8)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 2) testcase2(test)java.lang.ArrayIndexOutOfBoundsException: 2147483647
> at java.awt.image.DataBufferDouble.getElem(DataBufferDouble.java:166)
> at
> java.awt.image.SinglePixelPackedSampleModel.setPixels(SinglePixelPackedSampleModel.java:667)
> at test.testcase2(test.java:15)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> FAILURES!!!
> Tests run: 2, Failures: 0, Errors: 2
> Output on Harmony+drlvm/j9:
> ===========================
> ..
> Time: 0,015
> OK (2 tests)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.