harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r465460 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/geom/Area.java test/api/java/common/java/awt/geom/AreaTest.java
Date Thu, 19 Oct 2006 03:49:44 GMT
Author: ndbeyer
Date: Wed Oct 18 20:49:43 2006
New Revision: 465460

URL: http://svn.apache.org/viewvc?view=rev&rev=465460
Log:
Apply patch for HARMONY-1880: [classlib][awt] Area.createTransformedArea(..) throws NPE if
Area is

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Area.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Area.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Area.java?view=diff&rev=465460&r1=465459&r2=465460
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Area.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Area.java
Wed Oct 18 20:49:43 2006
@@ -197,7 +197,7 @@
     }
 
     public Area createTransformedArea(AffineTransform t) {
-        return new Area(t.createTransformedShape(s));
+        return s == null ? new Area() : new Area(t.createTransformedShape(s));
     }
 
     @Override

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java?view=diff&rev=465460&r1=465459&r2=465460
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java
Wed Oct 18 20:49:43 2006
@@ -82,5 +82,15 @@
         checkPathRule(path, PathIterator.WIND_NON_ZERO);
         checkPathDone(path, true);
     }
+    
+    public void testCreateTransformedArea() {
+        // Regression test HARMONY-1880
+        AffineTransform t = AffineTransform.getScaleInstance(2, 3);
+        Area a1 = new Area();        
+        Area a2 = a1.createTransformedArea(t);
+        PathIterator path = a2.getPathIterator(null);
+        checkPathRule(path, PathIterator.WIND_NON_ZERO);
+        checkPathDone(path, true);
+    }
 
 }



Mime
View raw message