You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2008/06/10 05:45:04 UTC

svn commit: r665962 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl

Author: dimuthu
Date: Mon Jun  9 20:45:03 2008
New Revision: 665962

URL: http://svn.apache.org/viewvc?rev=665962&view=rev
Log:
fix for AXIS2C-1159 - logic again corrected. so if user give NULL as an argument, the generated code force to check minOccurs

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

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl?rev=665962&r1=665961&r2=665962&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl Mon Jun  9 20:45:03 2008
@@ -4753,32 +4753,32 @@
                     {
                         non_nil_exists = AXIS2_TRUE;
                     }
-
-                    if(<xsl:value-of select="$name"/>->property_<xsl:value-of select="$CName"/> != NULL)
-                    {
-                        size = axutil_array_list_size(<xsl:value-of select="$name"/>->property_<xsl:value-of select="$CName"/>, env);
-                        for(j = 0, non_nil_count = 0; j &lt; size; j ++ )
+                    else {
+                        if(<xsl:value-of select="$name"/>->property_<xsl:value-of select="$CName"/> != NULL)
                         {
-                            if(i == j) continue; <!-- should not count the ith element -->
-                            if(NULL != axutil_array_list_get(<xsl:value-of select="$name"/>->property_<xsl:value-of select="$CName"/>, env, i))
+                            size = axutil_array_list_size(<xsl:value-of select="$name"/>->property_<xsl:value-of select="$CName"/>, env);
+                            for(j = 0, non_nil_count = 0; j &lt; size; j ++ )
                             {
-                                non_nil_count ++;
-                                non_nil_exists = AXIS2_TRUE;
-                                if(non_nil_count >= <xsl:value-of select="@minOccurs"/>)
+                                if(i == j) continue; <!-- should not count the ith element -->
+                                if(NULL != axutil_array_list_get(<xsl:value-of select="$name"/>->property_<xsl:value-of select="$CName"/>, env, i))
                                 {
-                                    break;
+                                    non_nil_count ++;
+                                    non_nil_exists = AXIS2_TRUE;
+                                    if(non_nil_count >= <xsl:value-of select="@minOccurs"/>)
+                                    {
+                                        break;
+                                    }
                                 }
                             }
-                        }
 
-                    <xsl:if test="not(@nillabe) and not(@minOccurs='0')"> <!-- if minOccurs=0 then no need to have error messages -->
-                        if( non_nil_count &lt; <xsl:value-of select="@minOccurs"/>)
-                        {
-                               AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of <xsl:value-of select="$propertyName"/> is beinng set to be smaller than the specificed number of minOccurs(<xsl:value-of select="@minOccurs"/>)");
-                               return AXIS2_FAILURE;
+                        <xsl:if test="not(@nillabe) and not(@minOccurs='0')"> <!-- if minOccurs=0 then no need to have error messages -->
+                            if( non_nil_count &lt; <xsl:value-of select="@minOccurs"/>)
+                            {
+                                   AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of <xsl:value-of select="$propertyName"/> is beinng set to be smaller than the specificed number of minOccurs(<xsl:value-of select="@minOccurs"/>)");
+                                   return AXIS2_FAILURE;
+                            }
+                        </xsl:if>
                         }
-                    </xsl:if>
-
                     }
                   </xsl:otherwise>
                 </xsl:choose>