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] Assigned: (HARMONY-2793) [classlib][awt] java.awt.image.IndexColorModel.getNormalizedComponents throws IllegalArgumentException on Harmony instead of ArrayIndexOutOfBoundsException
Date Thu, 11 Jan 2007 18:41:27 GMT

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

Alexei Zakharov reassigned HARMONY-2793:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][awt] java.awt.image.IndexColorModel.getNormalizedComponents throws IllegalArgumentException
on Harmony instead of ArrayIndexOutOfBoundsException
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2793
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2793
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: ColorModel.patch, ColorModelTest.patch
>
>
> According to the specification for getNormalizedComponents(int[] components, int offset,
float[] normComponents, int normOffset)
> "an ArrayIndexOutOfBoundsException is thrown if the normComponents array is not null
and is not large enough to hold all the color and alpha components (starting at normOffset)".
> Test listed below shows that Harmony throws IllegalArgumentException instead of
> ArrayIndexOutOfBoundsException.
> Test for reproducing:
> ------------- test.java -------------------
> import junit.framework.TestCase;
> import java.awt.*;
> import java.awt.image.*;
> public class test extends TestCase {      
>     public void test1 () { 
>         try {            
>             IndexColorModel obj=new IndexColorModel(1,1,new byte[]{1,1,1},0,false);
>             obj.getNormalizedComponents(new int[] {1,-23,5,67,89,0}, 1, new float[] {1,-23,5,67,89,0},
200);          
>             fail("ArrayIndexOutOfBoundsException should be thrown");
>         } catch (ArrayIndexOutOfBoundsException e) {
>             //expected  
>         }
>     }       
> }
> -------------------------------------------
> Output on RI:
> ==================
> .
> Time: 0
> OK (1 test)
> Output on Harmony:
> ==================
> 1) test1(test)java.lang.IllegalArgumentException: The length of normComponents minus
normOffset is less than numComponents
>         at
> java.awt.image.ColorModel.getNormalizedComponents(ColorModel.java:270)
>         at test.test1(test.java:7)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
> Note: The same issue is for IndexColorModel.getUnnormalizedComponents.

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