cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r704731 - /cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java
Date Tue, 14 Oct 2008 23:00:40 GMT
Author: bimargulies
Date: Tue Oct 14 16:00:39 2008
New Revision: 704731

URL: http://svn.apache.org/viewvc?rev=704731&view=rev
Log:
Fix CXF-1859.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java?rev=704731&r1=704730&r2=704731&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java Tue Oct 14 16:00:39
2008
@@ -101,12 +101,16 @@
     }
     
     /**
-     * Returns true if a value is either the String "true" or Boolean.TRUE.
+     * Returns true if a value is either the String "true" (regardless of case)  or Boolean.TRUE.
      * @param value
      * @return true iff value is either the String "true" or Boolean.TRUE
      */
     public static boolean isTrue(Object value) {
-        if (Boolean.TRUE.equals(value) || "true".equals(value)) {
+        if (value == null) {
+            return false;
+        }
+
+        if (Boolean.TRUE.equals(value) || "true".equalsIgnoreCase(value.toString())) {
             return true;
         }
         



Mime
View raw message