geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r219289 - /geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
Date Sat, 16 Jul 2005 06:37:57 GMT
Author: djencks
Date: Fri Jul 15 23:37:54 2005
New Revision: 219289

URL: http://svn.apache.org/viewcvs?rev=219289&view=rev
Log:
GERONIMO-768.  Fix 2 NPEs for doc/lit/wrapped with no in or out params corresponding to an
empty element

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java?rev=219289&r1=219288&r2=219289&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
Fri Jul 15 23:37:54 2005
@@ -229,12 +229,21 @@
 
             // schemaType should be complex using xsd:sequence compositor
             SchemaParticle parametersType = operationType.getContentModel();
-            if (SchemaParticle.ELEMENT == parametersType.getParticleType()) {
-                expectedInParams.add(parametersType.getName().getLocalPart());
-            } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) {
-                SchemaParticle[] parameters = parametersType.getParticleChildren();
-                for (int i = 0; i < parameters.length; i++) {
-                    expectedInParams.add(parameters[i].getName().getLocalPart());
+            //parametersType can be null if the element has empty content such as
+//            <element name="getMarketSummary">
+//             <complexType>
+//              <sequence/>
+//             </complexType>
+//            </element>
+
+            if (parametersType != null) {
+                if (SchemaParticle.ELEMENT == parametersType.getParticleType()) {
+                    expectedInParams.add(parametersType.getName().getLocalPart());
+                } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) {
+                    SchemaParticle[] parameters = parametersType.getParticleChildren();
+                    for (int i = 0; i < parameters.length; i++) {
+                        expectedInParams.add(parameters[i].getName().getLocalPart());
+                    }
                 }
             }
             if (!inParamNames.equals(expectedInParams)) {
@@ -297,12 +306,15 @@
 
             // schemaType should be complex using xsd:sequence compositor
             SchemaParticle parametersType = operationType.getContentModel();
-            if (SchemaParticle.ELEMENT == parametersType.getParticleType()) {
-                expectedOutParams.add(parametersType.getName().getLocalPart());
-            } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) {
-                SchemaParticle[] parameters = parametersType.getParticleChildren();
-                for (int i = 0; i < parameters.length; i++) {
-                    expectedOutParams.add(parameters[i].getName().getLocalPart());
+            //again, no output can give null parametersType
+            if (parametersType != null) {
+                if (SchemaParticle.ELEMENT == parametersType.getParticleType()) {
+                    expectedOutParams.add(parametersType.getName().getLocalPart());
+                } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) {
+                    SchemaParticle[] parameters = parametersType.getParticleChildren();
+                    for (int i = 0; i < parameters.length; i++) {
+                        expectedOutParams.add(parameters[i].getName().getLocalPart());
+                    }
                 }
             }
             if (!outParamNames.equals(expectedOutParams)) {



Mime
View raw message