In my last fix I changed isValid() to return false as long as the component isn't showing. While this fixed the Mauve test I've written for this, it broke an application I have here (which obviously overrides isShowing() in some weird way). The only way I could think of how to fix both Mauve and the app is to return peer != null && valid, which I committed.

2006-07-07  Roman Kennke  <[EMAIL PROTECTED]>

        * java/awt/Component.java
        (isValid): Return false when component has no peer,
        don't query the showing state.

/Roman
Index: java/awt/Component.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.131
diff -u -1 -2 -r1.131 Component.java
--- java/awt/Component.java	7 Jul 2006 12:14:05 -0000	1.131
+++ java/awt/Component.java	7 Jul 2006 14:07:27 -0000
@@ -739,25 +739,25 @@
   /**
    * Tests whether or not this component is valid. A invalid component needs
    * to have its layout redone.
    *
    * @return true if this component is valid
    * @see #validate()
    * @see #invalidate()
    */
   public boolean isValid()
   {
     // Tests show that components are invalid as long as they are not showing, even after validate()
     // has been called on them.
-    return isShowing() && valid;
+    return peer != null && valid;
   }
 
   /**
    * Tests if the component is displayable. It must be connected to a native
    * screen resource.  This reduces to checking that peer is not null.  A 
    * containment  hierarchy is made displayable when a window is packed or 
    * made visible.
    *
    * @return true if the component is displayable
    * @see Container#add(Component)
    * @see Container#remove(Component)
    * @see Window#pack()

Reply via email to