cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1519642 - in /cxf/branches/2.6.x-fixes: ./ api/src/main/java/org/apache/cxf/common/jaxb/ systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/ systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/ systests/...
Date Tue, 03 Sep 2013 10:42:40 GMT
Author: ffang
Date: Tue Sep  3 10:42:40 2013
New Revision: 1519642

URL: http://svn.apache.org/r1519642
Log:
Merged revisions 1519614 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1519614 | ffang | 2013-09-03 17:31:16 +0800 (二, 03  9 2013) | 9 lines
  
  Merged revisions 1519597 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1519597 | ffang | 2013-09-03 16:34:51 +0800 (二, 03  9 2013) | 1 line
    
    [CXF-5246]Conflicting schema namespaces for services with same set of schema classes
  ........
................

Added:
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/MultipleServiceShareClassTest.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/MultipleServiceShareClassTest.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/NameElement.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/NameElement.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/bar/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/bar/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/bar/BarName.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/bar/BarName.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/foo/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/foo/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/foo/FooName.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/model/foo/FooName.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/bar/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/bar/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/bar/BarServiceImpl.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/bar/BarServiceImpl.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/foo/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/foo/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/foo/FooServiceImpl.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/server/foo/FooServiceImpl.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/Getter.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/Getter.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/bar/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/bar/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/bar/BarService.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/bar/BarService.java
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/foo/
      - copied from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/foo/
    cxf/branches/2.6.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/foo/FooService.java
      - copied unchanged from r1519614, cxf/branches/2.7.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/shareclasses/service/foo/FooService.java
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1519614
  Merged /cxf/trunk:r1519597

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

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java?rev=1519642&r1=1519641&r2=1519642&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
(original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
Tue Sep  3 10:42:40 2013
@@ -31,6 +31,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.regex.Pattern;
 
@@ -120,8 +121,8 @@ public final class JAXBContextCache {  
         }
     }   
     
-    private static final Map<Set<Class<?>>, CachedContextAndSchemasInternal>
JAXBCONTEXT_CACHE
-        = new CacheMap<Set<Class<?>>, CachedContextAndSchemasInternal>();
+    private static final Map<Set<Class<?>>, Map<String, CachedContextAndSchemasInternal>>
JAXBCONTEXT_CACHE
+        = new CacheMap<Set<Class<?>>, Map<String, CachedContextAndSchemasInternal>>();
 
     private static final Map<Package, CachedClass> OBJECT_FACTORY_CACHE
         = new CacheMap<Package, CachedClass>(); 
@@ -186,15 +187,27 @@ public final class JAXBContextCache {  
         }
         CachedContextAndSchemasInternal cachedContextAndSchemasInternal = null;
         JAXBContext context = null;
+        Map<String, CachedContextAndSchemasInternal> cachedContextAndSchemasInternalMap
= null;
         if (typeRefs == null || typeRefs.isEmpty()) {
             synchronized (JAXBCONTEXT_CACHE) {
+                
                 if (exact) {
-                    cachedContextAndSchemasInternal = JAXBCONTEXT_CACHE.get(classes);
+                    cachedContextAndSchemasInternalMap
+                        = JAXBCONTEXT_CACHE.get(classes);
+                    if (cachedContextAndSchemasInternalMap != null && defaultNs !=
null) {
+                        cachedContextAndSchemasInternal = cachedContextAndSchemasInternalMap.get(defaultNs);
+                    }
                 } else {
-                    for (Map.Entry<Set<Class<?>>, CachedContextAndSchemasInternal>
k : JAXBCONTEXT_CACHE.entrySet()) {
+                    for (Entry<Set<Class<?>>, Map<String, CachedContextAndSchemasInternal>>
k 
+                            : JAXBCONTEXT_CACHE.entrySet()) {
                         Set<Class<?>> key = k.getKey();
                         if (key != null && key.containsAll(classes)) {
-                            cachedContextAndSchemasInternal = k.getValue();
+                            cachedContextAndSchemasInternalMap = k.getValue();
+                            if (defaultNs != null) {
+                                cachedContextAndSchemasInternal = cachedContextAndSchemasInternalMap.get(defaultNs);
+                            } else {
+                                cachedContextAndSchemasInternal = cachedContextAndSchemasInternalMap.get("");
+                            }
                             break;
                         }
                     }
@@ -236,7 +249,13 @@ public final class JAXBContextCache {  
         cachedContextAndSchemasInternal = new CachedContextAndSchemasInternal(context, classes);
         synchronized (JAXBCONTEXT_CACHE) {
             if (typeRefs == null || typeRefs.isEmpty()) {
-                JAXBCONTEXT_CACHE.put(classes, cachedContextAndSchemasInternal);
+                if (cachedContextAndSchemasInternalMap == null) {
+                    cachedContextAndSchemasInternalMap 
+                        = new CacheMap<String, CachedContextAndSchemasInternal>();
+                } 
+                cachedContextAndSchemasInternalMap.put((defaultNs != null) ? defaultNs :
"", 
+                    cachedContextAndSchemasInternal);
+                JAXBCONTEXT_CACHE.put(classes, cachedContextAndSchemasInternalMap);
             }
         }
 



Mime
View raw message