axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Scheuerle (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-3177) JAXWS: Concurrent Modification in Property Migrator
Date Thu, 06 Sep 2007 18:06:31 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-3177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rich Scheuerle updated AXIS2-3177:
----------------------------------

    Component/s: jaxws

> JAXWS: Concurrent Modification in Property Migrator
> ---------------------------------------------------
>
>                 Key: AXIS2-3177
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3177
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: jaxws
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Problem: 
> The code that iterates over the property keys in the JAXWS PropertyMigrator can result
in a concurrent modification exception.
> Solution:
> Dustin Amrhein provided a simple solution to avoid the property key iterator.
> The new code is:
> public void migratePropertiesToMessageContext(Map<String, Object> userContext,
>                                                   MessageContext messageContext) {
>         // Avoid using putAll as this causes copies of the propery set
>         if (userContext != null) {
>             // 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.
>                 if(key.equalsIgnoreCase(Constants.Configuration.ENABLE_MTOM)){
>                     value = messageContext.getMessage().isMTOMEnabled();
>                     messageContext.getMEPContext().put(key, value);
>                 }
>                 messageContext.setProperty(key, value);
>             }
>         }
>     }
> I will commit this change after I complete testing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message