Hey,

This patch fixes the format outputted of the toString method and the
order of the if-clause.  This patch now fixes a couple of failing Intel
tests.

2006-08-01  Tania Bento  <[EMAIL PROTECTED]>

        * java/awt/CardLayout.java
        (toString): Changed format of string outputted.
        (goToComponent): Changed the order of the if-clause.

Cheers,
Tania
Index: java/awt/CardLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/CardLayout.java,v
retrieving revision 1.16
diff -u -r1.16 CardLayout.java
--- java/awt/CardLayout.java	14 Jul 2006 12:43:20 -0000	1.16
+++ java/awt/CardLayout.java	1 Aug 2006 15:58:34 -0000
@@ -361,7 +361,7 @@
    */
   public String toString ()
   {
-    return getClass ().getName () + "[" + hgap + "," + vgap + "]";
+    return getClass ().getName () + "[hgap=" + hgap + ",vgap=" + vgap + "]";
   }
 
   /**
@@ -401,11 +401,11 @@
 	  {
 	    if (comps[i].isVisible ())
 	      {
-		if (what == NEXT)
+		if (choice == i)
 		  {
-		    choice = i + 1;
-		    if (choice == num)
-		      choice = 0;
+		    // Do nothing if we're already looking at the right
+                    // component.
+                    return;
 		  }
 		else if (what == PREV)
 		  {
@@ -413,11 +413,11 @@
 		    if (choice < 0)
 		      choice = num - 1;
 		  }
-		else if (choice == i)
+		else if (what == NEXT)
 		  {
-		    // Do nothing if we're already looking at the right
-		    // component.
-		    return;
+                    choice = i + 1;
+                    if (choice == num)
+                      choice = 0;
 		  }
 		comps[i].setVisible (false);
  

Reply via email to