harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r443332 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/geom/FlatteningPathIterator.java test/api/java/common/java/awt/geom/FlatteningPathIteratorTest.java
Date Thu, 14 Sep 2006 12:39:39 GMT
Author: hindessm
Date: Thu Sep 14 05:39:38 2006
New Revision: 443332

URL: http://svn.apache.org/viewvc?view=rev&rev=443332
Log:
Applied patches from "[#HARMONY-1419] [classlib][awt]
FlatteningPathIterator(null, 1) expected NPE".

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java?view=diff&rev=443332&r1=443331&r2=443332
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java
Thu Sep 14 05:39:38 2006
@@ -114,6 +114,9 @@
         if (limit < 0) {
             throw new IllegalArgumentException("Limit is less then zero");
         }
+        if (path == null) {
+            throw new NullPointerException("Path is null");
+        }
         this.p = path;
         this.flatness = flatness;
         this.flatness2 = flatness * flatness;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/FlatteningPathIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/FlatteningPathIteratorTest.java?view=diff&rev=443332&r1=443331&r2=443332
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/FlatteningPathIteratorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/FlatteningPathIteratorTest.java
Thu Sep 14 05:39:38 2006
@@ -43,18 +43,36 @@
         super.tearDown();
     }
 
-    public void testCreate() {
+    public void testCreateInvalid() {
         try {
             new FlatteningPathIterator(p, -1, 5);
-            fail("FlatteningPathIterator should throw exception IllegalArgumentException");
+            fail("expected IllegalArgumentException");
         } catch(IllegalArgumentException e) {
+            // expected
         }
 
         try {
             new FlatteningPathIterator(p, 1, -5);
-            fail("FlatteningPathIterator should throw exception IllegalArgumentException");
+            fail("expected IllegalArgumentException");
         } catch(IllegalArgumentException e) {
+            // expected
         }
+        
+        // Regression test HARMONY-1419
+        try {
+            new FlatteningPathIterator(null, -1, 5);
+            fail("expected IllegalArgumentException");
+        } catch(IllegalArgumentException e) {
+            // expected
+        }
+        
+        try {
+            new FlatteningPathIterator(null, 1, 5);
+            fail("expected NPE");
+        } catch(NullPointerException e) {
+            // expected
+        }
+        
     }
 
     public void testGetFlatness() {



Mime
View raw message