harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1404) [classlib][awt] Area doesn't throw NPE when input parameter is null
Date Fri, 08 Sep 2006 08:56:23 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1404?page=all ]

Denis Kishenko updated HARMONY-1404:
------------------------------------

    Attachment: 1404-Area.patch

patch + test

> [classlib][awt] Area doesn't throw NPE when input parameter is null
> -------------------------------------------------------------------
>
>                 Key: HARMONY-1404
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1404
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: 1404-Area.patch, 1404-AreaTest.patch
>
>
> Harmony implementation of Area doesn't throw NPE in some methods (see test) when input
parameter is null
> ============= Test.java ==================
> import java.awt.geom.*;
> public class Test {
>     public static void main(String[] argv) {
>         try {
>             System.err.println("Area()");
>             new Area(null);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("contains(Point2D)");
>             new Area().contains((Point2D)null);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("contains(Rectangle2D)");
>             new Area().contains((Rectangle2D)null);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("intersects(Rectangle2D)");
>             new Area().intersects((Rectangle2D)null);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
> }
> RI output ===========================
> Area()
> java.lang.NullPointerException
>     at java.awt.geom.Area.<init>(Area.java:54)
>     at Test.main(Test.java:8)
> contains(Point2D)
> java.lang.NullPointerException
>     at java.awt.geom.Area.contains(Area.java:403)
>     at Test.main(Test.java:14)
> contains(Rectangle2D)
> java.lang.NullPointerException
>     at java.awt.geom.Area.contains(Area.java:437)
>     at Test.main(Test.java:20)
> intersects(Rectangle2D)
> java.lang.NullPointerException
>     at java.awt.geom.Area.intersects(Area.java:470)
>     at Test.main(Test.java:26)
> Harmony output ===========================
> Area()
> contains(Point2D)
> contains(Rectangle2D)
> intersects(Rectangle2D)

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