Index: modules/awt/src/main/java/common/java/awt/geom/Arc2D.java =================================================================== --- modules/awt/src/main/java/common/java/awt/geom/Arc2D.java (revision 449668) +++ modules/awt/src/main/java/common/java/awt/geom/Arc2D.java (working copy) @@ -340,7 +340,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; Index: modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java =================================================================== --- modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java (revision 449668) +++ modules/awt/src/main/java/common/java/awt/geom/Ellipse2D.java (working copy) @@ -202,7 +202,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; } } Index: modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java =================================================================== --- modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java (revision 449668) +++ modules/awt/src/main/java/common/java/awt/geom/RoundRectangle2D.java (working copy) @@ -287,7 +287,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; } } Index: modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java =================================================================== --- modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java (revision 449668) +++ modules/awt/src/test/api/java/common/java/awt/geom/Arc2DTest.java (working copy) @@ -370,6 +370,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); } Index: modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java =================================================================== --- modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java (revision 449668) +++ modules/awt/src/test/api/java/common/java/awt/geom/Ellipse2DTest.java (working copy) @@ -27,6 +27,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); } Index: modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java =================================================================== --- modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java (revision 449668) +++ modules/awt/src/test/api/java/common/java/awt/geom/RoundRectangle2DTest.java (working copy) @@ -51,6 +51,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); }