cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r834235 - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java api/src/test/java/org/apache/cxf/databinding/ api/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
Date Mon, 09 Nov 2009 21:12:09 GMT
Author: dkulp
Date: Mon Nov  9 21:12:08 2009
New Revision: 834235

URL: http://svn.apache.org/viewvc?rev=834235&view=rev
Log:
Merged revisions 833963 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r833963 | bimargulies | 2009-11-08 20:46:43 -0500 (Sun, 08 Nov 2009) | 1 line
  
  CXF-2520. Fix checks for impossible namespace maps in AbstractDataBinding.
........

Added:
    cxf/branches/2.2.x-fixes/api/src/test/java/org/apache/cxf/databinding/
      - copied from r833963, cxf/trunk/api/src/test/java/org/apache/cxf/databinding/
    cxf/branches/2.2.x-fixes/api/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
      - copied unchanged from r833963, cxf/trunk/api/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java

Propchange: cxf/branches/2.2.x-fixes/
            ('svn:mergeinfo' removed)

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

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java?rev=834235&r1=834234&r2=834235&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
(original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
Mon Nov  9 21:12:08 2009
@@ -216,25 +216,21 @@
     }
 
     /**
-     * @return Returns the namespaceMap.
+     * @return the namespaceMap (URI to prefix). This will be null 
+     * if no particular namespace map has been set.
      */
     public Map<String, String> getNamespaceMap() {
         return namespaceMap;
     }
 
     /**
+     * Set a map of from URI to prefix. If possible, the data binding will use these 
+     * prefixes on the wire.
+     * 
      * @param namespaceMap The namespaceMap to set.
      */
     public void setNamespaceMap(Map<String, String> namespaceMap) {
-        // make some checks. This is a map from namespace to prefix, but we want unique prefixes.
-        if (namespaceMap != null) {
-            Set<String> prefixesSoFar = new HashSet<String>();
-            for (Map.Entry<String, String> mapping : namespaceMap.entrySet()) {
-                if (prefixesSoFar.contains(mapping.getValue())) {
-                    throw new IllegalArgumentException("Duplicate prefix " + mapping.getValue());
-                }
-            }
-        }
+        checkNamespaceMap(namespaceMap);
         this.namespaceMap = namespaceMap;
     }
 
@@ -253,6 +249,7 @@
                 if (prefixesSoFar.contains(mapping.getValue())) {
                     throw new IllegalArgumentException("Duplicate prefix " + mapping.getValue());
                 }
+                prefixesSoFar.add(mapping.getValue());
             }
         }
     }



Mime
View raw message