cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r542034 - /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
Date Sun, 27 May 2007 20:53:45 GMT
Author: dkulp
Date: Sun May 27 13:53:44 2007
New Revision: 542034

URL: http://svn.apache.org/viewvc?view=rev&rev=542034
Log:
Put all JAXWS standard properties in APPLICATION scope so they are copied correctly.   Change
mapping to avoid creating arrays and stuff.


Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java?view=diff&rev=542034&r1=542033&r2=542034
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
Sun May 27 13:53:44 2007
@@ -25,7 +25,6 @@
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import javax.activation.DataHandler;
 import javax.xml.ws.BindingProvider;
@@ -99,15 +98,10 @@
     }
     
     private static void mapContext(Map<String, Object> context, Map<String, String>
map) {
-        Set<String> keyset = context.keySet();
-        String[] keys = new String[0];
-        keys = keyset.toArray(keys);
-        for (int i = 0; i < keys.length; i++) {
-            String key = keys[i];
-            String mappingString = map.get(key);
-            if (null != mappingString) {
-                Object obj = context.get(key);
-                context.put(mappingString, obj);
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            Object o = context.get(entry.getKey());
+            if (o != null) {
+                context.put(entry.getValue(), o);
             }
         }
     }
@@ -143,15 +137,14 @@
     }
         
     private static void mapCxf2Jaxws(WrappedMessageContext context) {
-        Set<String> keyset = context.keySet();
-        String[] keys = new String[0];
-        keys = keyset.toArray(keys);
-        for (int i = 0; i < keys.length; i++) {
-            String key = keys[i];
-            String mappingString = cxf2jaxwsMap.get(key);
-            if (null != mappingString) {
-                Object obj = context.get(key);
-                context.put(mappingString, obj, Scope.APPLICATION);
+        
+        for (Map.Entry<String, String> entry : cxf2jaxwsMap.entrySet()) {
+            Object o = context.get(entry.getKey());
+            if (o != null) {
+                context.put(entry.getValue(), o, Scope.APPLICATION);
+            } else if (context.containsKey(entry.getValue())) {
+                context.put(entry.getValue(), 
+                            context.get(entry.getValue()), Scope.APPLICATION);          
     
             }
         }
         



Mime
View raw message