Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 01382200C3A for ; Fri, 31 Mar 2017 21:48:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F3DFC160B9C; Fri, 31 Mar 2017 19:48:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4EC82160B80 for ; Fri, 31 Mar 2017 21:48:09 +0200 (CEST) Received: (qmail 96639 invoked by uid 500); 31 Mar 2017 19:48:08 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 96541 invoked by uid 99); 31 Mar 2017 19:48:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Mar 2017 19:48:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4B54FDF99D; Fri, 31 Mar 2017 19:48:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkulp@apache.org To: commits@cxf.apache.org Date: Fri, 31 Mar 2017 19:48:09 -0000 Message-Id: <753ca173daf24c7e8e2934513f634445@git.apache.org> In-Reply-To: <9cfa7b4003c44c8d8346e6e130298d1f@git.apache.org> References: <9cfa7b4003c44c8d8346e6e130298d1f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cxf git commit: [CXF-6731/CXF-6580] Fix bug introduced by CXF-6580 archived-at: Fri, 31 Mar 2017 19:48:10 -0000 [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/d8d709cf Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d8d709cf Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d8d709cf Branch: refs/heads/3.0.x-fixes Commit: d8d709cfa69e99f81cf0fd3e21357be90040ea6a Parents: 8e4d8ed Author: Daniel Kulp Authored: Fri Mar 31 14:22:50 2017 -0400 Committer: Daniel Kulp Committed: Fri Mar 31 15:33:18 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/d8d709cf/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 8daf996..e9f1611 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 ids = new HashSet(); + Set ids = new HashSet<>(); + @SuppressWarnings("unchecked") List serviceList = (List)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 serviceList, + Options opts, + SchemaCompiler schemaCompiler, + SchemaCollection schemaCollection) { + Set 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/d8d709cf/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 27236f8..f3cc145 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 @@ -1196,6 +1196,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 {