This patch (committed) adds argument checking to a couple of methods in AbstractButton, and fixes a bunch of tests in the Intel test suite:

2006-07-09  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/AbstractButton.java
        (setHorizontalTextPosition): Added check for illegal argument,
        (setVerticalTextPosition): Likewise.

Regards,

Dave
Index: javax/swing/AbstractButton.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/AbstractButton.java,v
retrieving revision 1.63
diff -u -r1.63 AbstractButton.java
--- javax/swing/AbstractButton.java     7 Jul 2006 16:06:55 -0000       1.63
+++ javax/swing/AbstractButton.java     9 Jul 2006 21:19:56 -0000
@@ -1364,6 +1364,9 @@
   {
     if (horizontalTextPosition == t)
       return;
+    if (t != LEFT && t != CENTER && t != RIGHT && t != LEADING 
+        && t != TRAILING)
+      throw new IllegalArgumentException("Invalid alignment.");
 
     int old = horizontalTextPosition;
     horizontalTextPosition = t;
@@ -1442,6 +1445,8 @@
   {
     if (verticalTextPosition == t)
       return;
+    if (t != TOP && t != CENTER && t != BOTTOM)
+      throw new IllegalArgumentException("Invalid alignment.");
     
     int old = verticalTextPosition;
     verticalTextPosition = t;

Reply via email to