This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: AWT fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 10 Mar 2002 11:45:02 -0700
- Subject: Patch: FYI: AWT fixlet
- Reply-to: tromey at redhat dot com
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;