harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r464480 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/geom/ test/api/java/common/java/awt/geom/
Date Mon, 16 Oct 2006 13:23:08 GMT
Author: hindessm
Date: Mon Oct 16 06:23:07 2006
New Revision: 464480

URL: http://svn.apache.org/viewvc?view=rev&rev=464480
Log:
Applied patch from "[#HARMONY-1585] [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI".

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Arc2D.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Arc2D.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Arc2D.java?view=diff&rev=464480&r1=464479&r2=464480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Arc2D.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Arc2D.java
Mon Oct 16 06:23:07 2006
@@ -341,7 +341,7 @@
          * @param at - the AffineTransform object to apply rectangle path
          */
         Iterator(Arc2D a, AffineTransform t) {
-            if (a.isEmpty()) {
+            if (width < 0 || height < 0) {
                 arcCount = 0;
                 lineCount = 0;
                 index = 1;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java?view=diff&rev=464480&r1=464479&r2=464480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java
Mon Oct 16 06:23:07 2006
@@ -203,7 +203,7 @@
             this.width = e.getWidth();
             this.height = e.getHeight();
             this.t = t;
-            if (width <= 0.0 || height <= 0.0) {
+            if (width < 0.0 || height < 0.0) {
                 index = 6;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java?view=diff&rev=464480&r1=464479&r2=464480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java
Mon Oct 16 06:23:07 2006
@@ -288,7 +288,7 @@
             this.aw = Math.min(width, rr.getArcWidth());
             this.ah = Math.min(height, rr.getArcHeight());
             this.t = at;
-            if (width <= 0.0 || height <= 0.0 || aw <= 0.0 || ah <= 0.0) {
+            if (width < 0.0 || height < 0.0 || aw < 0.0 || ah < 0.0) {
                 index = points.length;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java?view=diff&rev=464480&r1=464479&r2=464480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java
Mon Oct 16 06:23:07 2006
@@ -371,6 +371,13 @@
         }
     }
 
+    public void testGetPathIteratorEmpty() {
+        // Regression test HARMONY-1585
+        Arc2D a = new Arc2D.Double();
+        PathIterator p = a.getPathIterator(null);
+        checkPathMove(p, true, 0, 0, 0.0);
+    }
+    
     public static void main(String[] args) {
         junit.textui.TestRunner.run(Arc2DTest.class);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java?view=diff&rev=464480&r1=464479&r2=464480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java
Mon Oct 16 06:23:07 2006
@@ -28,6 +28,18 @@
         filterShape = createFilter("^(ellipse).*([.]shape)$", null);
     }
 
+    public void testGetPathIteratorEmpty() {
+        // Regression test HARMONY-1585
+        Ellipse2D e = new Ellipse2D.Double();
+        PathIterator p = e.getPathIterator(null);
+        checkPathMove(p, false, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathClose(p, true);
+    }
+    
     public static void main(String[] args) {
         junit.textui.TestRunner.run(Ellipse2DTest.class);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java?view=diff&rev=464480&r1=464479&r2=464480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java
Mon Oct 16 06:23:07 2006
@@ -52,6 +52,22 @@
         assertEquals(6.0, r.getArcHeight(), 0.0);
     }
 
+    public void testGetPathIteratorEmpty() {
+        // Regression test HARMONY-1585
+        RoundRectangle2D e = new RoundRectangle2D.Double();
+        PathIterator p = e.getPathIterator(null);
+        checkPathMove(p, false, 0, 0, 0.0);
+        checkPathLine(p, false, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathLine(p, false, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathLine(p, false, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathLine(p, false, 0, 0, 0.0);
+        checkPathCubic(p, false, 0, 0, 0, 0, 0, 0, 0.0);
+        checkPathClose(p, true);
+    }
+    
     public static void main(String[] args) {
         junit.textui.TestRunner.run(RoundRectangle2DTest.class);
     }



Mime
View raw message