Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B05FCBD31 for ; Wed, 18 Jan 2012 19:29:59 +0000 (UTC) Received: (qmail 10820 invoked by uid 500); 18 Jan 2012 19:29:59 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 10756 invoked by uid 500); 18 Jan 2012 19:29:58 -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 10749 invoked by uid 99); 18 Jan 2012 19:29:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2012 19:29:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2012 19:29:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4F6E423889C5 for ; Wed, 18 Jan 2012 19:29:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1233011 - in /cxf/branches/2.4.x-fixes: ./ api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Date: Wed, 18 Jan 2012 19:29:37 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120118192937.4F6E423889C5@eris.apache.org> Author: dkulp Date: Wed Jan 18 19:29:36 2012 New Revision: 1233011 URL: http://svn.apache.org/viewvc?rev=1233011&view=rev Log: Merged revisions 1233007 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ................ r1233007 | dkulp | 2012-01-18 14:25:46 -0500 (Wed, 18 Jan 2012) | 10 lines Merged revisions 1233006 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1233006 | dkulp | 2012-01-18 14:19:29 -0500 (Wed, 18 Jan 2012) | 2 lines [CXF-4042] Only remove the schemaLocations for the schemas that JAXB actually generates ........ ................ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Propchange: cxf/branches/2.4.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java?rev=1233011&r1=1233010&r2=1233011&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java (original) +++ cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java Wed Jan 18 19:29:36 2012 @@ -90,6 +90,13 @@ public abstract class AbstractDataBindin public XmlSchema addSchemaDocument(ServiceInfo serviceInfo, SchemaCollection col, Document d, String systemId) { + return addSchemaDocument(serviceInfo, col, d, systemId, null); + } + public XmlSchema addSchemaDocument(ServiceInfo serviceInfo, + SchemaCollection col, + Document d, + String systemId, + Collection ids) { /* @@ -161,7 +168,10 @@ public abstract class AbstractDataBindin Element e = (Element)n; if (e.getLocalName().equals("import")) { e = (Element)n; - e.removeAttribute("schemaLocation"); + String loc = e.getAttribute("schemaLocation"); + if (ids == null || ids.contains(loc)) { + e.removeAttribute("schemaLocation"); + } updateSchemaLocation(e); if (StringUtils.isEmpty(e.getAttribute("namespace"))) { e.setAttribute("namespace", serviceInfo.getInterface().getName() Modified: cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=1233011&r1=1233010&r2=1233011&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java (original) +++ cxf/branches/2.4.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Wed Jan 18 19:29:36 2012 @@ -31,6 +31,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -334,6 +335,10 @@ public class JAXBDataBinding extends Abs throw new ServiceConstructionException("SCHEMA_GEN_EXC", LOG, e); } } + Set ids = new HashSet(); + for (DOMSource r : schemas) { + ids.add(r.getSystemId()); + } for (DOMSource r : schemas) { if (bi.contains(r)) { String ns = ((Document)r.getNode()).getDocumentElement().getAttribute("targetNamespace");