On Fri, 2006-03-17 at 13:15 -0500, Thomas Fitzsimmons wrote:
> On Fri, 2006-03-17 at 10:12 -0700, Tom Tromey wrote:
> > >>>>> "Tom" == Thomas Fitzsimmons <[EMAIL PROTECTED]> writes:
> > 
> > Tom> This patch comes from Caolan McNamara.  It completes our Spring and
> > Tom> SpringLayout implementations.
> > 
> > Nice!
> > 
> > Tom> +  //  protected abstract String springdebug();
> > 
> > Commented-out code ... gross.
> > In this case it seems to me that the debug stuff could comfortably be
> > put into toString() methods.
> 
> Good point.  Fix committed.
> 
> Tom
> 
> 2006-03-17  Thomas Fitzsimmons  <[EMAIL PROTECTED]>
> 
>       * javax/swing/Spring.java: Uncomment springdebug methods and
>       rename them toString.
>       * javax/swing/SpringLayout.java: Likewise.
> 
Index: javax/swing/Spring.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/Spring.java,v
retrieving revision 1.6
diff -u -r1.6 Spring.java
--- javax/swing/Spring.java	16 Mar 2006 23:54:52 -0000	1.6
+++ javax/swing/Spring.java	17 Mar 2006 18:08:42 -0000
@@ -71,8 +71,6 @@
     // Nothing to do here.
   }
 
-  //  protected abstract String springdebug();
-
   /**
    * Creates a Spring which min, pref and max values are all the same.
    * These kind of Springs are 'struts'.
@@ -352,10 +350,10 @@
     /** The actual value of the spring. */
     private int value;
 
-//     protected String springdebug()
-//     {
-//         return "SimpleSpring of " + value;
-//     }
+    public String toString()
+    {
+      return "SimpleSpring of " + value;
+    }
 
     /**
      * Creates a new SimpleSpring object.
@@ -441,10 +439,10 @@
     /** The current value for this Spring. */
     private int value;
 
-//     protected String springdebug()
-//     {
-//         return "AddSpring of " + s1.springdebug() + " and " + s2.springdebug();
-//     }
+    public String toString()
+    {
+      return "AddSpring of " + s1 + " and " + s2;
+    }
 
     /**
      * Creates a new AddSpring object.
@@ -553,10 +551,10 @@
     /** The Spring from which to calculate the negation. */
     private final Spring s;
 
-//     protected String springdebug()
-//     {
-//         return "MinusSpring of " + s.springdebug();
-//     }
+    public String toString()
+    {
+      return "MinusSpring of " + s;
+    }
 
     /**
      * Creates a new MinusSpring object.
@@ -634,10 +632,10 @@
     private final Spring s1;
     private final Spring s2;
 
-//     protected String springdebug()
-//     {
-//         return "MaxSpring of " + s1.springdebug() + " and " + s2.springdebug();
-//     }
+    public String toString()
+    {
+      return "MaxSpring of " + s1 + " and " + s2;
+    }
 
     /** The current value of this Spring. */
     private int value;
Index: javax/swing/SpringLayout.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/SpringLayout.java,v
retrieving revision 1.9
diff -u -r1.9 SpringLayout.java
--- javax/swing/SpringLayout.java	16 Mar 2006 23:54:52 -0000	1.9
+++ javax/swing/SpringLayout.java	17 Mar 2006 18:08:42 -0000
@@ -459,10 +459,10 @@
     private String edgeName;
     private Component c;
 
-//     protected String springdebug()
-//     {
-//         return "DeferredSpring of edge" + edgeName + " of " + "something";
-//     }
+    public String toString()
+    {
+      return "DeferredSpring of edge" + edgeName + " of " + "something";
+    }
 
     public DeferredSpring(SpringLayout s, String edge, Component component)
     {
@@ -537,10 +537,10 @@
         c = component;
     }
 
-//     protected String springdebug()
-//     {
-//         return "DeferredWidth of " + "something";
-//     }
+    public String toString()
+    {
+      return "DeferredWidth of " + "something";
+    }
 
     //clip max to a value we can do meaningful calculation with
     public int getMaximumValue() 
@@ -564,10 +564,10 @@
   {
     private Component c;
 
-//     protected String springdebug()
-//     {
-//         return "DeferredHeight of " + "something";
-//     }
+    public String toString()
+    {
+        return "DeferredHeight of " + "something";
+    }
 
     public DeferredHeight(Component component)
     {

Reply via email to