ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant Project.java
Date Wed, 03 Sep 2003 15:22:10 GMT
jhm         2003/09/03 08:22:10

  Modified:    src/main/org/apache/tools/ant Project.java
  Log:
  Let Project.toBoolean(String) handle null as argument.
  
  Revision  Changes    Path
  1.152     +5 -6      ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.151
  retrieving revision 1.152
  diff -u -r1.151 -r1.152
  --- Project.java	25 Aug 2003 15:29:14 -0000	1.151
  +++ Project.java	3 Sep 2003 15:22:10 -0000	1.152
  @@ -1569,16 +1569,15 @@
        * or <code>"yes"</code> is found, ignoring case.
        *
        * @param s The string to convert to a boolean value.
  -     *          Must not be <code>null</code>.
        *
        * @return <code>true</code> if the given string is <code>"on"</code>,
        *         <code>"true"</code> or <code>"yes"</code>, or
        *         <code>false</code> otherwise.
        */
       public static boolean toBoolean(String s) {
  -        return (s.equalsIgnoreCase("on")
  -                || s.equalsIgnoreCase("true")
  -                || s.equalsIgnoreCase("yes"));
  +        return ("on".equalsIgnoreCase(s)
  +                || "true".equalsIgnoreCase(s)
  +                || "yes".equalsIgnoreCase(s));
       }
   
       /**
  @@ -2097,4 +2096,4 @@
               // is private/protected.
           }
       }
  -}
  +}
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message