cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/3] cxf git commit: [CXF-6731/CXF-6580] Fix bug introduced by CXF-6580
Date Fri, 31 Mar 2017 19:32:12 GMT
[CXF-6731/CXF-6580] Fix bug introduced by CXF-6580

# Conflicts:
#	tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f8511a5e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f8511a5e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f8511a5e

Branch: refs/heads/3.1.x-fixes
Commit: f8511a5e52ad9055514a4b6aa3ad102ae0f0ae55
Parents: 2d04ee0
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Mar 31 14:22:50 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Mar 31 15:31:55 2017 -0400

----------------------------------------------------------------------
 .../wsdlto/databinding/jaxb/JAXBDataBinding.java   | 17 +++++++++++++----
 .../cxf/tools/wsdlto/jaxws/CodeGenBugTest.java     |  8 ++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f8511a5e/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
index d85ee7d..41f1eeb 100644
--- a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
+++ b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
@@ -604,12 +604,12 @@ public class JAXBDataBinding implements DataBindingProfile {
         return result;
     }
 
-    @SuppressWarnings("unchecked")
     private void addSchemas(Options opts,
                             SchemaCompiler schemaCompiler,
                             SchemaCollection schemaCollection) {
 
-        Set<String> ids = new HashSet<String>();
+        Set<String> ids = new HashSet<>();
+        @SuppressWarnings("unchecked")
         List<ServiceInfo> serviceList = (List<ServiceInfo>)context.get(ToolConstants.SERVICE_LIST);
         for (ServiceInfo si : serviceList) {
             for (SchemaInfo sci : si.getSchemas()) {
@@ -672,8 +672,10 @@ public class JAXBDataBinding implements DataBindingProfile {
                 continue;
             }
             String key = schema.getSourceURI();
+            String tns = schema.getTargetNamespace();
+            String ltns = schema.getLogicalTargetNamespace();
             // accepting also a null tns (e.g., reported by apache.ws.xmlschema for no-namespace)
-            if (ids.contains(key)) {
+            if (ids.contains(key) || (tns == null && !StringUtils.isEmpty(ltns)))
{
                 continue;
             }
             if (key.startsWith("file:") || key.startsWith("jar:")) {
@@ -706,7 +708,14 @@ public class JAXBDataBinding implements DataBindingProfile {
                 }
             }
         }
-        ids.clear();
+        addSchemasForServiceInfos(catalog, serviceList, opts, schemaCompiler, schemaCollection);
+    }
+    private void addSchemasForServiceInfos(OASISCatalogManager catalog,
+                                           List<ServiceInfo> serviceList,
+                                          Options opts,
+                                          SchemaCompiler schemaCompiler,
+                                          SchemaCollection schemaCollection) {
+        Set<String> ids = new HashSet<>();
         for (ServiceInfo si : serviceList) {
             for (SchemaInfo sci : si.getSchemas()) {
                 String key = sci.getSystemId();

http://git-wip-us.apache.org/repos/asf/cxf/blob/f8511a5e/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
index 30d3031..db2acba 100644
--- a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
+++ b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
@@ -1195,6 +1195,14 @@ public class CodeGenBugTest extends AbstractCodeGenTest {
             fail("shouldn't get exception");
         }
     }
+    
+
+    @Test
+    public void testsdfasdf() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, "/Users/dkulp/Downloads/test/WSDL.wsdl");
+        processor.setContext(env);
+        processor.execute();
+    }
 
     @Test
     public void testCXF5280() throws Exception {


Mime
View raw message