Hey,

This patch fixes a bug in
java.awt.CardLayout.maximumLayoutSize(Component).  If Component has no
components, then a new Dimension with value Integer.MAX_VALUE for both
its width and height should be returned.  

This patch causes a failing Harmony test to pass.  I have also committed
a mauve test for these changes.

Cheers,
Tania

2007-01-03  Tania Bento  <[EMAIL PROTECTED]>

        * java/awt/CardLayout.java:
        (maximumLayoutSize): Return a new Dimension with a width of
value
        Integer.MAX_VALUE and a height of value Integer.MAX_VALUE if
Component
        has no components.

Index: java/awt/CardLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/CardLayout.java,v
retrieving revision 1.18
diff -u -r1.18 CardLayout.java
--- java/awt/CardLayout.java	18 Oct 2006 21:51:04 -0000	1.18
+++ java/awt/CardLayout.java	3 Jan 2007 19:04:13 -0000
@@ -225,7 +225,7 @@
    */
   public Dimension maximumLayoutSize (Container target)
   {
-    if (target == null)
+    if (target == null || target.ncomponents == 0)
       return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     // The JCL says that this returns Integer.MAX_VALUE for both
     // dimensions.  But that just seems wrong to me.

Reply via email to