cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r741152 - in /cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws: processor/internal/ParameterProcessor.java validator/WrapperStyleNameCollisionValidator.java
Date Thu, 05 Feb 2009 16:00:39 GMT
Author: dkulp
Date: Thu Feb  5 16:00:39 2009
New Revision: 741152

URL: http://svn.apache.org/viewvc?rev=741152&view=rev
Log:
[CXF-2024] If only one part in the return wrapper, there isn't a conflict.  If multple parts,
there is.

Modified:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=741152&r1=741151&r2=741152&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Thu Feb  5 16:00:39 2009
@@ -334,19 +334,21 @@
         if (outputWrapElement.size() == 1 && inputWrapElement != null) {
             QName outElement = outputWrapElement.iterator().next();
             boolean sameWrapperChild = false;
-            for (QName inElement : inputWrapElement) {
-                if (isSameWrapperChild(inElement, outElement)) {
-                    JavaParameter  jp = getParameterFromQName(outputPart.getElementQName(),
outElement,
-                                                              JavaType.Style.INOUT, outputPart);
-                    if (!qualified) {
-                        jp.setTargetNamespace("");
-                    }
-                    addParameter(method, jp);
-                    sameWrapperChild = true;
-                    if (method.getReturn() == null) {
-                        addVoidReturn(method);
+            if (outputWrapElement.size() > 1) {
+                for (QName inElement : inputWrapElement) {
+                    if (isSameWrapperChild(inElement, outElement)) {
+                        JavaParameter  jp = getParameterFromQName(outputPart.getElementQName(),
outElement,
+                                                                  JavaType.Style.INOUT, outputPart);
+                        if (!qualified) {
+                            jp.setTargetNamespace("");
+                        }
+                        addParameter(method, jp);
+                        sameWrapperChild = true;
+                        if (method.getReturn() == null) {
+                            addVoidReturn(method);
+                        }
+                        break;
                     }
-                    break;
                 }
             }
             if (!sameWrapperChild) {
@@ -638,13 +640,13 @@
     private boolean isSamePart(MessagePartInfo part1, MessagePartInfo part2) {
         QName qname1 = part1.getElementQName();
         QName qname2 = part2.getElementQName();
+        QName tname1 = part1.getTypeQName();
+        QName tname2 = part2.getTypeQName();
         if (qname1 != null && qname2 != null) {
-            return qname1.equals(qname2);
+            return qname1.equals(qname2) && (tname1 == null || tname1.equals(tname2));
         }
-        qname1 = part1.getTypeQName();
-        qname2 = part2.getTypeQName();
-        if (qname1 != null && qname2 != null) {
-            return qname1.equals(qname2);
+        if (tname1 != null && tname2 != null) {
+            return tname1.equals(tname2);
         }
         return false;
     }

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java?rev=741152&r1=741151&r2=741152&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
Thu Feb  5 16:00:39 2009
@@ -20,6 +20,7 @@
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.validator;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.logging.Logger;
 import javax.xml.namespace.QName;
@@ -116,15 +117,17 @@
         }
 
         if (output != null) {
-            for (WrapperElement element : ProcessorUtil.getWrappedElement(context, 
-                                                                          output.getElementQName()))
{
-                if (names.containsKey(element.getElementName())
-                    &&  !(names.get(element.getElementName()) == element.getSchemaTypeName()
-                        || names.get(element.getElementName()).equals(element.getSchemaTypeName())))
{
-                    handleErrors(names.get(element.getElementName()), element);
-                    return false;
-                } else {
-                    names.put(element.getElementName(), element.getSchemaTypeName());
+            List<WrapperElement> els = ProcessorUtil.getWrappedElement(context, output.getElementQName());
+            if (els.size() > 1) {
+                for (WrapperElement element : els) {
+                    if (names.containsKey(element.getElementName())
+                        &&  !(names.get(element.getElementName()) == element.getSchemaTypeName()
+                            || names.get(element.getElementName()).equals(element.getSchemaTypeName())))
{
+                        handleErrors(names.get(element.getElementName()), element);
+                        return false;
+                    } else {
+                        names.put(element.getElementName(), element.getSchemaTypeName());
+                    }
                 }
             }
         }



Mime
View raw message