cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel BooleanField.java
Date Thu, 06 Nov 2003 13:23:47 GMT
vgritsenko    2003/11/06 05:23:47

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/formmodel
                        BooleanField.java
  Log:
  Reduce amount of stacktraces in the log (set value to FALSE as written in javadoc)
  Woody masters, please review :)
  
  Revision  Changes    Path
  1.7       +10 -1     cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/BooleanField.java
  
  Index: BooleanField.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/BooleanField.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BooleanField.java	24 Oct 2003 22:49:08 -0000	1.6
  +++ BooleanField.java	6 Nov 2003 13:23:47 -0000	1.7
  @@ -131,9 +131,18 @@
           return value;
       }
   
  +    /**
  +     * Sets value of the field. If value is null, it is considered to be false
  +     * (see class comment).
  +     */
       public void setValue(Object object) {
  -        if (!(object instanceof Boolean))
  +        if (object == null) {
  +            object = Boolean.FALSE;
  +        }
  +        
  +        if (!(object instanceof Boolean)) {
               throw new RuntimeException("Cannot set value of boolean field \"" + getFullyQualifiedId()
+ "\" to a non-Boolean value.");
  +        }
           
           Object oldValue = value;
           value = (Boolean)object;
  
  
  

Mime
View raw message