You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by ru...@apache.org on 2001/07/16 03:44:14 UTC
cvs commit: xml-soap/java/src/org/apache/soap/encoding/soapenc BooleanDeserializer.java
rubys 01/07/15 18:44:14
Modified: java/src/org/apache/soap/encoding/soapenc
BooleanDeserializer.java
Log:
Per the spec, 0 and 1 are valid boolean values (and, in fact, are the ones
used by the WhiteMesa implementation). I updated the BooleanDeserializer
to be very liberal in what it will accept.
Revision Changes Path
1.2 +13 -1 xml-soap/java/src/org/apache/soap/encoding/soapenc/BooleanDeserializer.java
Index: BooleanDeserializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/BooleanDeserializer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BooleanDeserializer.java 2001/01/09 05:35:26 1.1
+++ BooleanDeserializer.java 2001/07/16 01:44:14 1.2
@@ -79,6 +79,18 @@
Element root = (Element)src;
String value = DOMUtils.getChildCharacterData(root);
- return new Bean(boolean.class, new Boolean(value));
+ if ((value == null) || (value.length() == 0))
+ throw new IllegalArgumentException("Missing boolean value");
+
+ switch (value.charAt(0)) {
+ case '0': case 'f': case 'F':
+ return new Bean(boolean.class, Boolean.FALSE);
+
+ case '1': case 't': case 'T':
+ return new Bean(boolean.class, Boolean.TRUE);
+
+ default:
+ throw new IllegalArgumentException("Invalid boolean value: " + value);
+ }
}
}
Re: cvs commit: xml-soap/java/src/org/apache/soap/encoding/soapenc BooleanDeserializer.java
Posted by herry <he...@graffiti.net>.
How do I unsubscribe from this mailing list? This isn't what I wanted.