This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: AWT fixlet


I'm checking this in.
This fixes an obvious bug in AWT.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* java/awt/GridLayout.java (setColumns): Check newCols, not cols.
	(setRows): Check newRows, not rows.

Index: java/awt/GridLayout.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/GridLayout.java,v
retrieving revision 1.8
diff -u -r1.8 GridLayout.java
--- java/awt/GridLayout.java 10 Nov 2002 00:16:42 -0000 1.8
+++ java/awt/GridLayout.java 10 Nov 2002 17:34:42 -0000
@@ -245,7 +245,7 @@
    */
   public void setColumns (int newCols)
   {
-    if (cols < 0)
+    if (newCols < 0)
       throw new IllegalArgumentException ("number of columns cannot be negative");
     if (newCols == 0 && rows == 0)
       throw new IllegalArgumentException ("number of rows is already 0");
@@ -271,7 +271,7 @@
    */
   public void setRows (int newRows)
   {
-    if (rows < 0)
+    if (newRows < 0)
       throw new IllegalArgumentException ("number of rows cannot be negative");
     if (newRows == 0 && cols == 0)
       throw new IllegalArgumentException ("number of columns is already 0");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]