> > Roman>    public void setAlignment (int align)
> > Roman>    {
> > Roman> -    if (align != LEFT && align != RIGHT && align != CENTER
> > Roman> -    && align != LEADING && align != TRAILING)
> > Roman> -      throw new IllegalArgumentException ("invalid alignment: " + 
> > align);
> > Roman>      this.align = align;
> > Roman>    }
> >  
> > It would be nice to have a comment here explaining why we don't do
> > the check.
> 
> Ok, I'll add this.

Added.

2005-08-18  Roman Kennke  <[EMAIL PROTECTED]>

        * java/awt/FlowLayout.java
        (setAlignment): Added comment explaining why we don't check
        for illegal values here.

/Roman

Index: java/awt/FlowLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/FlowLayout.java,v
retrieving revision 1.15
diff -u -r1.15 FlowLayout.java
--- java/awt/FlowLayout.java	15 Aug 2005 09:14:00 -0000	1.15
+++ java/awt/FlowLayout.java	18 Aug 2005 14:07:38 -0000
@@ -269,6 +269,9 @@
    */
   public void setAlignment (int align)
   {
+    // The JDK accepts invalid values and treats them as
+    // LEFT during layout, so do we. The invalid value is even stored,
+    // getAlignment() returns the same invalid value.
     this.align = align;
   }
 
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to