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:07:41 UTC

svn commit: r501434 - in /webservices/jaxme/trunk/ws-jaxme: jaxme-jm/src/main/java/org/apache/ws/jaxme/generator/types/BooleanSG.java status.xml

Author: jochen
Date: Tue Jan 30 08:07:40 2007
New Revision: 501434

URL: http://svn.apache.org/viewvc?view=rev&rev=501434
Log:
The handling of primitive boolean default values was incorrect.

Modified:
    webservices/jaxme/trunk/ws-jaxme/jaxme-jm/src/main/java/org/apache/ws/jaxme/generator/types/BooleanSG.java
    webservices/jaxme/trunk/ws-jaxme/status.xml

Modified: webservices/jaxme/trunk/ws-jaxme/jaxme-jm/src/main/java/org/apache/ws/jaxme/generator/types/BooleanSG.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jm/src/main/java/org/apache/ws/jaxme/generator/types/BooleanSG.java?view=diff&rev=501434&r1=501433&r2=501434
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jm/src/main/java/org/apache/ws/jaxme/generator/types/BooleanSG.java (original)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jm/src/main/java/org/apache/ws/jaxme/generator/types/BooleanSG.java Tue Jan 30 08:07:40 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/trunk/ws-jaxme/status.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/status.xml?view=diff&rev=501434&r1=501433&r2=501434
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/status.xml (original)
+++ webservices/jaxme/trunk/ws-jaxme/status.xml Tue Jan 30 08:07:40 2007
@@ -73,6 +73,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