You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by am...@apache.org on 2009/10/06 16:58:45 UTC

svn commit: r822303 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Author: amilas
Date: Tue Oct  6 14:58:44 2009
New Revision: 822303

URL: http://svn.apache.org/viewvc?rev=822303&view=rev
Log:
added the uwc option to top level elements with simple types and let uwc enable even for elements
not having minOccurs or nillable. This is done to support the interop test cases with uses boundary values 

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=822303&r1=822302&r2=822303&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Tue Oct  6 14:58:44 2009
@@ -470,6 +470,12 @@
             //find the class name
             String className = findClassName(qName, isArray(xsElt));
 
+            // element declared at the top level and have simple types may
+            // use primitive type if we do not add this check
+            if (options.isUseWrapperClasses() && PrimitiveTypeFinder.isPrimitive(className)) {
+                className = PrimitiveTypeWrapper.getWrapper(className);
+            }
+
             //this means the schema type actually returns a different QName
             if (changedTypeMap.containsKey(qName)) {
                 metainf.registerMapping(xsElt.getQName(),
@@ -597,9 +603,7 @@
 
                     // always store the class name in the element meta Info itself
                     // this details only needed by the unwrappig to set the complex type
-                    if (options.isUseWrapperClasses() &&
-                            PrimitiveTypeFinder.isPrimitive(className) &&
-                            ((xsElt.getMinOccurs() == 0) || (xsElt.isNillable()))) {
+                    if (options.isUseWrapperClasses() && PrimitiveTypeFinder.isPrimitive(className)) {
                           className = PrimitiveTypeWrapper.getWrapper(className);
                     }
                     schemaType.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY, className);