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-1403) [classlib][awt] Arc2D doesn't throw IAE for invalid type value
Date Wed, 13 Sep 2006 10:08:24 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1403?page=all ]

Mikhail Loenko resolved HARMONY-1403.
-------------------------------------

    Resolution: Fixed

applied in revision 442924
Denis, please check that it was applied as expected

> [classlib][awt] Arc2D doesn't throw IAE for invalid type value
> --------------------------------------------------------------
>
>                 Key: HARMONY-1403
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1403
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mikhail Loenko
>         Attachments: 1403-Arc2D tests.patch, 1403-Arc2D.patch
>
>
> Harmony implementation of Arc2D doesn't validate arc type value while RI does. 
> =============== Test.java ==================
> import java.awt.geom.*;
> public class Test {
>    public static void main(String[] argv) {
>        Arc2D arc;
>        try {
>            System.err.println("double");
>            arc = new Arc2D.Double(1, 2, 3, 4, 5, 6, 17);
>        } catch (IllegalArgumentException e) {
>            e.printStackTrace();           
>        }
>        try {
>            System.err.println("float");
>            arc = new Arc2D.Float(1, 2, 3, 4, 5, 6, -13);
>        } catch (IllegalArgumentException e) {
>            e.printStackTrace();           
>        }
>        try {
>            System.err.println("double.setarc");
>            arc = new Arc2D.Double(1, 2, 3, 4, 5, 6, 0);
>            arc.setArcType(11);
>        } catch (IllegalArgumentException e) {
>            e.printStackTrace();           
>        }
>        try {
>            System.err.println("float.setarc");
>            arc = new Arc2D.Float(1, 2, 3, 4, 5, 6, 0);
>            arc.setArcType(11);
>        } catch (IllegalArgumentException e) {
>            e.printStackTrace();           
>        }
>    }
> }
> RI Output ==========================
> double
> java.lang.IllegalArgumentException: invalid type for Arc: 17
>     at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
>     at java.awt.geom.Arc2D.<init>(Arc2D.java:570)
>     at java.awt.geom.Arc2D$Double.<init>(Arc2D.java:381)
>     at Test.main(Test.java:8)
> float
> java.lang.IllegalArgumentException: invalid type for Arc: -13
>     at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
>     at java.awt.geom.Arc2D.<init>(Arc2D.java:570)
>     at java.awt.geom.Arc2D$Float.<init>(Arc2D.java:131)
>     at Test.main(Test.java:14)
> double.setarc
> java.lang.IllegalArgumentException: invalid type for Arc: 11
>     at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
>     at Test.main(Test.java:21)
> float.setarc
> java.lang.IllegalArgumentException: invalid type for Arc: 11
>     at java.awt.geom.Arc2D.setArcType(Arc2D.java:872)
>     at Test.main(Test.java:28)
> Harmony Output ====================
> double
> float
> double.setarc
> float.setarc

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