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/23 18:59:49 UTC

[jira] Assigned: (HARMONY-2712) [classlib][awt][compatibility] java.awt.image.Raster.createBandedRaster(int,int,int,int,int[],int[],Point) throws ArrayIndexOutOfBoundsException while Ri throws NPE

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

Alexei Zakharov reassigned HARMONY-2712:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][awt][compatibility] java.awt.image.Raster.createBandedRaster(int,int,int,int,int[],int[],Point) throws ArrayIndexOutOfBoundsException while Ri throws NPE
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2712
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2712
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Oleg Khaschansky
>         Assigned To: Alexei Zakharov
>            Priority: Trivial
>
> RI throws unspecified NPE while Harmony throws specified ArrayIndexOutOfBoundsException. API specification says: "ArrayIndexOutOfBoundsException - if bankIndices or bandOffsets is null". This issue seems to be mostly RI problem. I think it is a non-bug difference from RI.
> Testcase:
> import junit.framework.TestCase;
> import java.awt.Point;
> import java.awt.image.Raster;
> import java.awt.image.WritableRaster;
> import java.awt.image.RasterFormatException;
> public class test extends TestCase 
> {
>         public void testcase0()
>         {
>                 int[] array0 = new int[] {};
>                 int[] array1 =null;
>                 Point localPoint = new Point(-17796, 8);
>                 try 
>                 {
>                        
> Raster.createBandedRaster(9,65412,5,-1,array0,array1,localPoint);
>                         assertEquals(true, false);
>                 }
>                 catch (IllegalArgumentException expectedException) 
>                 {
>                         fail(expectedException +" was thrown");
>                 }
>                 catch (ArrayIndexOutOfBoundsException expectedException) 
>                 {
>                         System.out.println(expectedException +" was thrown");
>                         assertEquals(true,true);
>                 }
>   }
> } 
> OUTPUT:
> Harmony+j9
> .java.lang.ArrayIndexOutOfBoundsException: bankIndices or bandOffsets is null
> was thrown
> Time: 0.031
> OK (1 test)
> ------------------------------------------------------------------------
> Harmony+drlvm
> .java.lang.ArrayIndexOutOfBoundsException: bankIndices or bandOffsets is null
> was thrown
> Time: 0.032
> OK (1 test)
> ------------------------------------------------------------------------
> RI
> .E
> Time: 0.125
> There was 1 error:
> 1) testcase0(test)java.lang.NullPointerException
>         at java.awt.image.Raster.createBandedRaster(Raster.java:362)
>         at test.testcase0(test.java:16)
>         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: 1,  Failures: 0,  Errors: 1
> If array1 is just empty (not null!) RI also throws ArrayIndexOutOfBoundsException while Harmony throws IllegalArgumentException , which is correct. So it's RI's behavior contradicts the spec.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.