harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r466069 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/Polygon.java test/api/java/common/java/awt/PolygonTest.java
Date Fri, 20 Oct 2006 11:34:47 GMT
Author: mloenko
Date: Fri Oct 20 04:34:47 2006
New Revision: 466069

URL: http://svn.apache.org/viewvc?view=rev&rev=466069
Log:
applied patch from HARMONY-1572
[classlib][awt] If Polygon is empty then PathIterator.isDone() returns FALSE while RI returns
TRUE

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Polygon.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/PolygonTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Polygon.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Polygon.java?view=diff&rev=466069&r1=466068&r2=466069
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Polygon.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Polygon.java
Fri Oct 20 04:34:47 2006
@@ -75,6 +75,9 @@
         public Iterator(AffineTransform at, Polygon p) {
             this.p = p;
             this.t = at;
+            if (p.npoints == 0) {
+                index = 1;
+            }
         }
 
         public int getWindingRule() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/PolygonTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/PolygonTest.java?view=diff&rev=466069&r1=466068&r2=466069
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/PolygonTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/PolygonTest.java
Fri Oct 20 04:34:47 2006
@@ -271,6 +271,15 @@
                 new float[]{4, 5, 5, 6, 6, 7});
     }
 
+    public void testGetPathIteratorEmpty() {
+        // Regression for HARMONY-1572
+        Polygon pg = new Polygon(new int[] { 1, 2, 3 }, new int[] { 4, 5, 6 },
+                0);
+        PathIterator p = pg.getPathIterator(null);
+        checkPathRule(p, PathIterator.WIND_EVEN_ODD);
+        checkPathDone(p, true);
+    }
+
     @Override
     public String objToStr(Object obj) {
         Polygon p = (Polygon)obj;



Mime
View raw message