commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r589050 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/BooleanUtils.java test/org/apache/commons/lang/BooleanUtilsTest.java
Date Sat, 27 Oct 2007 05:07:46 GMT
Author: bayard
Date: Fri Oct 26 22:07:45 2007
New Revision: 589050

URL: http://svn.apache.org/viewvc?rev=589050&view=rev
Log:
Applying Sebb's test and fix for LANG-365

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/BooleanUtils.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/BooleanUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/BooleanUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/BooleanUtils.java?rev=589050&r1=589049&r2=589050&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/BooleanUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/BooleanUtils.java Fri Oct 26
22:07:45 2007
@@ -679,6 +679,7 @@
                         (str.charAt(1) == 'E' || str.charAt(1) == 'e') &&
                         (str.charAt(2) == 'S' || str.charAt(2) == 's');
                 }
+                return false;
             }
             case 4: {
                 char ch = str.charAt(0);

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/BooleanUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/BooleanUtilsTest.java?rev=589050&r1=589049&r2=589050&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/BooleanUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/BooleanUtilsTest.java Fri Oct
26 22:07:45 2007
@@ -330,6 +330,8 @@
         assertEquals(true, BooleanUtils.toBoolean("YeS"));
         assertEquals(true, BooleanUtils.toBoolean("YEs"));
         assertEquals(true, BooleanUtils.toBoolean("YES"));
+        assertEquals(false, BooleanUtils.toBoolean("yes?"));
+        assertEquals(false, BooleanUtils.toBoolean("tru"));
     }
 
     public void test_toBoolean_String_String_String() {



Mime
View raw message