harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Pavlenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2431) [classlib][awt] SinglePixelPackedSampleModel.getSamples() expected ArrayIndexOutOfBoundsException
Date Mon, 22 Jan 2007 15:32:30 GMT

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

Andrey Pavlenko updated HARMONY-2431:
-------------------------------------

    Attachment: SinglePixelPackedSampleModelTest.patch
                SinglePixelPackedSampleModel.patch

> [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
>         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.
-
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