You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2007/09/06 20:02:16 UTC

svn commit: r573327 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java

Author: scheu
Date: Thu Sep  6 11:02:12 2007
New Revision: 573327

URL: http://svn.apache.org/viewvc?rev=573327&view=rev
Log:
AXIS2-3177
Contributor: Dustin Amrhein
Quick Fix to avoid concurrent modification exception in the JAX-WS Property Migrator.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java?rev=573327&r1=573326&r2=573327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java Thu Sep  6 11:02:12 2007
@@ -53,10 +53,15 @@
 
     public void migratePropertiesToMessageContext(Map<String, Object> userContext,
                                                   MessageContext messageContext) {
-        
+
         // Avoid using putAll as this causes copies of the propery set
         if (userContext != null) {
-            for (String key: userContext.keySet()) {
+            // should not use iterator here because this map may be modified
+            // on different threads by the user or other JAX-WS code
+            String[] keys = new String[userContext.keySet().size()];
+            keys = userContext.keySet().toArray(keys);
+            for(int i=0; i < keys.length; i++) {
+                String key = keys[i];
                 Object value = userContext.get(key);
                 // Make sure mtom state in the user context, the message context, 
                 // the MEP context are the same.



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org