Il giorno lun, 10/07/2006 alle 12.26 -0600, Tom Tromey ha scritto:

> There are a couple of these... make this change and check it in.
> Thanks.

Committed :)

These were only the first of a series, I'll try to make another couple
before to go.

Mario

--------

2006-07-10  Mario Torre  <[EMAIL PROTECTED]>

        * java/awt/BasicStroke.java: Removed unused import.
        * gnu/java/awt/java2d/CubicSegment.java (clone): Fixed. 
        * gnu/java/awt/java2d/LineSegment.java (clone): Fixed. 
        * gnu/java/awt/java2d/QuadSegment.java (clone): Fixed.


-- 
Lima Software, SO.PR.IND. s.r.l.
http://www.limasoftware.net/
pgp key: http://subkeys.pgp.net/

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/
Index: gnu/java/awt/java2d/CubicSegment.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/java/awt/java2d/CubicSegment.java,v
retrieving revision 1.1
diff -u -r1.1 CubicSegment.java
--- gnu/java/awt/java2d/CubicSegment.java	24 Apr 2006 14:37:23 -0000	1.1
+++ gnu/java/awt/java2d/CubicSegment.java	10 Jul 2006 18:37:19 -0000
@@ -78,8 +78,25 @@
    */
   public Object clone()
   {
-    return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(),
-                            cp2.getX(), cp2.getY(), P2.getX(), P2.getY());
+    CubicSegment segment = null;
+    
+    try
+      {
+        segment = (CubicSegment) super.clone();
+        
+        segment.P1 = (Point2D) P1.clone();
+        segment.P2 = (Point2D) P2.clone();
+        segment.cp1 = (Point2D) cp1.clone();
+        segment.cp2 = (Point2D) cp2.clone();
+      }
+    catch (CloneNotSupportedException cnse)
+      {
+        InternalError ie = new InternalError();
+        ie.initCause(cnse);
+        throw ie;
+      }
+  
+    return segment;
   }
 
   /**
@@ -100,7 +117,6 @@
     double[] p1 = normal(x0, y0, x1, y1);
     double[] p2 = normal(x2, y2, x3, y3);
 
-    
     // FIXME: Doesn't compile.
     // return new Segment[]{s1, s2};
     return new Segment[0];
Index: gnu/java/awt/java2d/LineSegment.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/java/awt/java2d/LineSegment.java,v
retrieving revision 1.1
diff -u -r1.1 LineSegment.java
--- gnu/java/awt/java2d/LineSegment.java	24 Apr 2006 14:37:23 -0000	1.1
+++ gnu/java/awt/java2d/LineSegment.java	10 Jul 2006 18:37:19 -0000
@@ -62,7 +62,22 @@
    */
   public Object clone()
   {
-    return new LineSegment(P1, P2);
+    LineSegment segment = null;
+    
+    try
+      {
+        segment = (LineSegment) super.clone();
+        segment.P1 = (Point2D) P1.clone();
+        segment.P2 = (Point2D) P2.clone();
+      }
+    catch (CloneNotSupportedException cnse)
+      {
+        InternalError ie = new InternalError();
+        ie.initCause(cnse);
+        throw ie;
+      }
+    
+    return segment;
   }
 
   /**
Index: gnu/java/awt/java2d/QuadSegment.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/java/awt/java2d/QuadSegment.java,v
retrieving revision 1.1
diff -u -r1.1 QuadSegment.java
--- gnu/java/awt/java2d/QuadSegment.java	24 Apr 2006 14:37:23 -0000	1.1
+++ gnu/java/awt/java2d/QuadSegment.java	10 Jul 2006 18:37:19 -0000
@@ -88,8 +88,24 @@
    */
   public Object clone()
   {
-    return new QuadSegment(P1.getX(), P1.getY(), cp.getX(), cp.getY(),
-                           P2.getX(), P2.getY());
+    QuadSegment segment = null;
+    
+    try
+      {
+        segment = (QuadSegment) super.clone();
+
+        segment.P1 = (Point2D) P1.clone();
+        segment.P2 = (Point2D) P2.clone();
+        segment.cp = (Point2D) cp.clone();
+      }
+    catch (CloneNotSupportedException cnse)
+      {
+        InternalError ie = new InternalError();
+        ie.initCause(cnse);
+        throw ie;
+      }
+    
+    return segment;
   }
 
   /**
Index: java/awt/BasicStroke.java
===================================================================
RCS file: /sources/classpath/classpath/java/awt/BasicStroke.java,v
retrieving revision 1.13
diff -u -r1.13 BasicStroke.java
--- java/awt/BasicStroke.java	15 Jun 2006 18:09:25 -0000	1.13
+++ java/awt/BasicStroke.java	10 Jul 2006 18:37:23 -0000
@@ -43,7 +43,6 @@
 import gnu.java.awt.java2d.QuadSegment;
 import gnu.java.awt.java2d.Segment;
 
-import java.awt.geom.AffineTransform;
 import java.awt.geom.GeneralPath;
 import java.awt.geom.PathIterator;
 import java.awt.geom.Point2D;

Attachment: signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente

Reply via email to