Patch: FYI: AWT fixlet

Tom Tromey tromey@redhat.com
Sun Mar 10 12:58:00 GMT 2002


I'm checking this in.

This fixes an AWT bug I ran into last night.  I'm only checking this
in on the trunk.  Since AWT isn't going to be a supported feature on
the branch, I think there's no point changing it there.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* java/awt/GridLayout.java (layoutContainer): Handle case where
	there are no items in container.

Index: java/awt/GridLayout.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/GridLayout.java,v
retrieving revision 1.6
diff -u -r1.6 GridLayout.java
--- java/awt/GridLayout.java 2002/01/29 16:31:24 1.6
+++ java/awt/GridLayout.java 2002/03/10 18:12:02
@@ -152,6 +152,12 @@
   public void layoutContainer (Container parent)
   {
     int num = parent.ncomponents;
+
+    // There's no point, and handling this would mean adding special
+    // cases.
+    if (num == 0)
+      return;
+
     // This is more efficient than calling getComponents().
     Component[] comps = parent.component;
 



More information about the Java-patches mailing list