harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-1405) [classlib][awt] AffineTransform.transform(Point2D[], int, Point2D[], int, int) expected NPE
Date Fri, 20 Oct 2006 05:03:36 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1405?page=all ]

Mikhail Loenko resolved HARMONY-1405.
-------------------------------------

    Resolution: Fixed

applied in revision 465993
Denis please check if it was applied as expected

> [classlib][awt] AffineTransform.transform(Point2D[], int, Point2D[], int, int) expected
NPE
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1405
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1405
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mikhail Loenko
>         Attachments: 1405-AffineTransform.patch, 1405-AffineTransformTest.patch
>
>
> Harmony throws ArrayIndexOutOfBoundsException while RI throws NPE if source offset is
correct and destination offset is incorrect and source buffer contains nulls (see results
5 and 7). Spec doesn't say anything about exceptions.
> =========== Test.java ==================
> import java.awt.geom.AffineTransform;
> import java.awt.geom.Point2D;
> public class Test {
>     
>     static public void test(String name, Point2D[] src, int srcOff, Point2D[] dst, int
dstOff, int length) {
>         try {
>             System.err.print(name + " ");
>             AffineTransform t = new AffineTransform();
>             t.transform(src, srcOff, dst, dstOff, length);
>             System.err.println("ok");
>         } catch (Exception e) {
>             System.err.println(e);
>         }
>     }
>     static public void main(String[] args) {
>         test("1",                
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 0);
>         test("2",                
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 1);
>         test("3",                
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 -1);
>         test("4",                
>                 new Point2D[] { null, null, null, null },
>                 -1,
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 1);
>         test("5",                
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 new Point2D[] { null, null, null, null },
>                 -1,
>                 1);
>         test("6",                
>                 new Point2D[] { null, null, null, null },
>                 10,
>                 new Point2D[] { null, null, null, null },
>                 0,
>                 1);
>         test("7",                
>                 new Point2D[] { null, null, null, null },
>                 1,
>                 new Point2D[] { null, null, null, null },
>                 10,
>                 1);
>         test("8",                
>                 new Point2D[] { new Point2D.Double(), new Point2D.Double(), new Point2D.Double(),
new Point2D.Double() },
>                 2,
>                 new Point2D[] { new Point2D.Double(), new Point2D.Double(), new Point2D.Double(),
new Point2D.Double() },
>                 3,
>                 10);
>         test("9",                
>                 new Point2D[] { new Point2D.Double(), new Point2D.Double(), new Point2D.Double(),
new Point2D.Double() },
>                 2,
>                 new Point2D[] { new Point2D.Double(), new Point2D.Double(), new Point2D.Double(),
new Point2D.Double() },
>                 3,
>                 -1);
>         test("10",                
>                 new Point2D[] { new Point2D.Double(), new Point2D.Double(), new Point2D.Double(),
new Point2D.Double() },
>                 2,
>                 new Point2D[] { new Point2D.Double(), new Point2D.Double(), new Point2D.Double(),
new Point2D.Double() },
>                 3,
>                 -4);
>         test("11",                
>                 new Point2D[] { null, null, null, null },
>                 11,
>                 new Point2D[] { null, null, null, null },
>                 12,
>                 1);
>     }
> }
> RI output =================================
> 1 ok
> 2 java.lang.NullPointerException
> 3 ok
> 4 java.lang.ArrayIndexOutOfBoundsException
> 5 java.lang.NullPointerException
> 6 java.lang.ArrayIndexOutOfBoundsException
> 7 java.lang.NullPointerException
> 8 java.lang.ArrayIndexOutOfBoundsException
> 9 ok
> 10 ok
> 11 java.lang.ArrayIndexOutOfBoundsException
> Harmony output =============================
> 1 ok
> 2 java.lang.NullPointerException
> 3 ok
> 4 java.lang.ArrayIndexOutOfBoundsException
> 5 java.lang.ArrayIndexOutOfBoundsException
> 6 java.lang.ArrayIndexOutOfBoundsException
> 7 java.lang.ArrayIndexOutOfBoundsException
> 8 java.lang.ArrayIndexOutOfBoundsException
> 9 ok
> 10 ok
> 11 java.lang.ArrayIndexOutOfBoundsException

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

        

Mime
View raw message