cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r123797 - /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java
Date Fri, 31 Dec 2004 14:56:42 GMT
Author: antonio
Date: Fri Dec 31 06:56:41 2004
New Revision: 123797

URL: http://svn.apache.org/viewcvs?view=rev&rev=123797
Log:
Avoid suspicious comparison
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java?view=diff&rev=123797&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java&r1=123796&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java&r2=123797
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java
Fri Dec 31 06:56:41 2004
@@ -30,6 +30,7 @@
 import org.apache.cocoon.forms.formmodel.MultiValueField;
 import org.apache.cocoon.forms.formmodel.Repeater;
 import org.apache.cocoon.forms.formmodel.Widget;
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.excalibur.xml.sax.XMLizable;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -305,9 +306,10 @@
                 data(datatype.convertToString(widget.getValue(), this.locale));
         } else if (widget instanceof BooleanField) {
             // FIXME: BooleanField should implement DataWidget, which
-            // would make this case unnesecary
-            if (widget.getValue() != null)
-                data((Boolean)widget.getValue() == Boolean.TRUE ? "true" : "false");
+            // would make this case unnecesary
+            if (widget.getValue() != null) {
+                data(BooleanUtils.toStringTrueFalse((Boolean)widget.getValue()));
+            }
         } else if (widget instanceof MultiValueField) {
             Datatype datatype = ((MultiValueField)widget).getDatatype();
             Object[] values = (Object[])widget.getValue();

Mime
View raw message