commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wer...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression ExpressionSupport.java
Date Fri, 28 Jun 2002 03:30:24 GMT
werken      2002/06/27 20:30:24

  Modified:    jelly/src/java/org/apache/commons/jelly/expression
                        ExpressionSupport.java
  Log:
  Better coercion of strings to bools.
  
  Revision  Changes    Path
  1.5       +23 -6     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/ExpressionSupport.java
  
  Index: ExpressionSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/ExpressionSupport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExpressionSupport.java	22 Jun 2002 23:53:55 -0000	1.4
  +++ ExpressionSupport.java	28 Jun 2002 03:30:24 -0000	1.5
  @@ -102,7 +102,24 @@
               return b.booleanValue();
           }
           else if ( value instanceof String ) {
  -            return Boolean.getBoolean( (String) value );
  +            // return Boolean.getBoolean( (String) value );
  +            String str = (String) value;
  +
  +            if ( str.equals( "on" )
  +                 ||
  +                 str.equals( "yes" )
  +                 ||
  +                 str.equals( "1" )
  +                 ||
  +                 str.equals( "true" ) )
  +            {
  +                return true;
  +            }
  +            else
  +            {
  +                return false;
  +            }
  +
           }
           return false;
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message