You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/06/18 18:34:01 UTC

svn commit: r956043 - in /cxf/branches/2.2.x-fixes: ./ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java

Author: dkulp
Date: Fri Jun 18 16:34:01 2010
New Revision: 956043

URL: http://svn.apache.org/viewvc?rev=956043&view=rev
Log:
Merged revisions 956036 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r956036 | dkulp | 2010-06-18 12:14:36 -0400 (Fri, 18 Jun 2010) | 4 lines
  
  [CXF-2855] Fix issue with xjc customizations not getting through to XJC
  plugins.
  
  Patch from "nitro" applied.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=956043&r1=956042&r2=956043&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Fri Jun 18 16:34:01 2010
@@ -238,7 +238,9 @@ public final class CustomizationParser {
     }
 
     protected void copyAllJaxbDeclarations(final Node schemaNode, final Element jaxwsBindingNode) {
-        appendJaxbVersion((Element)schemaNode);
+        if (isSchemaElement((Element)schemaNode)) {
+            appendJaxbVersion((Element)schemaNode);
+        }
 
         Node[] embededNodes = getAnnotationNodes(schemaNode);
         Node annotationNode = embededNodes[0];
@@ -247,15 +249,18 @@ public final class CustomizationParser {
         for (Node childNode = jaxwsBindingNode.getFirstChild();
             childNode != null;
             childNode = childNode.getNextSibling()) {
-            
-            copyJaxbAttributes(childNode, (Element)schemaNode);
-            
-            if (!isJaxbBindings(childNode)) {
+
+            if (isSchemaElement((Element)schemaNode)) {
+                copyJaxbAttributes(childNode, (Element)schemaNode);
+            }
+
+            //TODO: check for valid extension namespaces
+            if (!(childNode instanceof Element)) { //!isJaxbBindings(childNode)) {
                 continue;
             }
             
             Element childEl = (Element)childNode;
-            if (isJaxbBindingsElement(childEl)) {
+            if (isJaxbBindings(childNode) && isJaxbBindingsElement(childEl)) {
                 
                 NodeList nlist = nodeSelector.queryNodes(schemaNode, childEl.getAttribute("node"));
                 for (int i = 0; i < nlist.getLength(); i++) {
@@ -307,7 +312,7 @@ public final class CustomizationParser {
                         String pfxs = attr.getValue();
                         while (pfxs.length() > 0) {
                             String pfx = pfxs;
-                            int idx = pfx.indexOf(',');
+                            int idx = pfx.indexOf(' ');
                             if (idx != -1) {
                                 pfxs = pfxs.substring(idx + 1);
                                 pfx = pfx.substring(0, idx);
@@ -598,6 +603,11 @@ public final class CustomizationParser {
         return this.wsdlNode;
     }
 
+    private boolean isSchemaElement(Node schema) {
+        return ToolConstants.SCHEMA_URI.equals(schema.getNamespaceURI())
+               && "schema".equals(schema.getLocalName());
+    }
+
     private boolean isJAXWSBindings(Node bindings) {
         return ToolConstants.NS_JAXWS_BINDINGS.equals(bindings.getNamespaceURI())
                && "bindings".equals(bindings.getLocalName());