You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by jo...@apache.org on 2007/01/30 17:08:13 UTC
svn commit: r501435 - in /webservices/jaxme/branches/b0_5:
src/jaxme/org/apache/ws/jaxme/generator/types/BooleanSG.java status.xml
Author: jochen
Date: Tue Jan 30 08:08:12 2007
New Revision: 501435
URL: http://svn.apache.org/viewvc?view=rev&rev=501435
Log:
The handling of primitive boolean default values was incorrect.
Modified:
webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/BooleanSG.java
webservices/jaxme/branches/b0_5/status.xml
Modified: webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/BooleanSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/BooleanSG.java?view=diff&rev=501435&r1=501434&r2=501435
==============================================================================
--- webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/BooleanSG.java (original)
+++ webservices/jaxme/branches/b0_5/src/jaxme/org/apache/ws/jaxme/generator/types/BooleanSG.java Tue Jan 30 08:08:12 2007
@@ -50,20 +50,30 @@
public JavaQName getPrimitiveRuntimeType(SimpleTypeSG pController) { return BOOLEAN_TYPE; }
protected JavaQName getObjectRuntimeType(SimpleTypeSG pController) { return BOOLEAN_OBJECT_TYPE; }
- public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
- try {
- return new TypedValueImpl(new DatatypeConverterImpl().parseBoolean(pValue) ? Boolean.TRUE : Boolean.FALSE,
- BOOLEAN_OBJECT_TYPE);
- } catch (RuntimeException e) {
- try {
- throw new LocSAXException("Failed to convert string value to "
- + getDatatypeName() + " instance: " + pValue, getLocator());
- } catch (Exception e1) {
- throw new SAXException("Failed to convert string value to "
- + getDatatypeName() + " instance: " + pValue);
- }
- }
- }
+ public TypedValue getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
+ final Boolean b;
+ try {
+ b = new DatatypeConverterImpl().parseBoolean(pValue) ? Boolean.TRUE : Boolean.FALSE;
+ } catch (RuntimeException e) {
+ try {
+ throw new LocSAXException("Failed to convert string value to "
+ + getDatatypeName() + " instance: " + pValue, getLocator());
+ } catch (Exception e1) {
+ throw new SAXException("Failed to convert string value to "
+ + getDatatypeName() + " instance: " + pValue);
+ }
+ }
+ final Object value;
+ final JavaQName type;
+ if (pController.isNullable()) {
+ value = new Object[]{Boolean.class, ".", (b.booleanValue() ? "TRUE" : "FALSE")};
+ type = BOOLEAN_OBJECT_TYPE;
+ } else {
+ value = b;
+ type = BOOLEAN_TYPE;
+ }
+ return new TypedValueImpl(value, type);
+ }
public boolean isCausingParseConversionEvent(SimpleTypeSG pController) {
return false;
Modified: webservices/jaxme/branches/b0_5/status.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/branches/b0_5/status.xml?view=diff&rev=501435&r1=501434&r2=501435
==============================================================================
--- webservices/jaxme/branches/b0_5/status.xml (original)
+++ webservices/jaxme/branches/b0_5/status.xml Tue Jan 30 08:08:12 2007
@@ -57,6 +57,9 @@
Fixed an NPE when using minExclusive.
(Brian Uri, buri@fgm.com)
</action>
+ <action dev="JW" type="fix" context="generator">
+ The handling for primitive boolean default values was incorrect.
+ </action>
</release>
<release version="0.5.2" date="25-Oct-2006">
<action dev="JW" type="enhancement" context="generator">
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org