cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
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 GMT
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<String> 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<String> ids = new HashSet<String>();
+            for (DOMSource r : schemas) {
+                ids.add(r.getSystemId());
+            }
             for (DOMSource r : schemas) {
                 if (bi.contains(r)) {
                     String ns = ((Document)r.getNode()).getDocumentElement().getAttribute("targetNamespace");



Mime
View raw message