Hey,

This patch modifies the string representation returned in
java.awt.event.ComponentEvent.paramString().  This fix now passes a
failing intel test.  I have also committed a mauve test.

Cheers,
Tania

2006-11-03  Tania Bento  <[EMAIL PROTECTED]>

        * java/awt/event/ComponentEvent.java
        (paramString): Changed format of string representation returned.

Index: java/awt/event/ComponentEvent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/event/ComponentEvent.java,v
retrieving revision 1.7
diff -u -r1.7 ComponentEvent.java
--- java/awt/event/ComponentEvent.java	2 Jul 2005 20:32:28 -0000	1.7
+++ java/awt/event/ComponentEvent.java	3 Nov 2006 15:03:54 -0000
@@ -1,5 +1,5 @@
 /* ComponentEvent.java -- notification of events for components
-   Copyright (C) 1999, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2005, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -114,24 +114,27 @@
    */
   public String paramString()
   {
+    StringBuffer s = new StringBuffer();
+    
     // Unlike Sun, we don't throw NullPointerException or ClassCastException
     // when source was illegally changed.
-    switch (id)
-      {
-      case COMPONENT_MOVED:
-        return "COMPONENT_MOVED "
-          + (source instanceof Component
-             ? ((Component) source).getBounds() : (Object) "");
-      case COMPONENT_RESIZED:
-        return "COMPONENT_RESIZED "
-          + (source instanceof Component
-             ? ((Component) source).getBounds() : (Object) "");
-      case COMPONENT_SHOWN:
-        return "COMPONENT_SHOWN";
-      case COMPONENT_HIDDEN:
-        return "COMPONENT_HIDDEN";
-      default:
-        return "unknown type";
-      }
+    if (id == COMPONENT_MOVED)
+      s.append("COMPONENT_MOVED ");
+    else if (id == COMPONENT_RESIZED) 
+      s.append("COMPONENT_RESIZED ");
+    else if (id == COMPONENT_SHOWN)
+      s.append("COMPONENT_SHOWN ");
+    else if (id == COMPONENT_HIDDEN)
+      s.append("COMPONENT_HIDDEN ");
+    else
+      return "unknown type";
+
+    s.append("(").append(getComponent().getX()).append(",")
+      .append(getComponent().getY()).append(" ")
+      .append(getComponent().getWidth()).append("x")
+      .append(getComponent().getHeight()).append(")");
+
+    return s.toString();
   }
+  
 } // class ComponentEvent

Reply via email to