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 "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2007/09/06 20:04:32 UTC
[jira] Resolved: (AXIS2-3177) JAXWS: Concurrent Modification in
Property Migrator
[ https://issues.apache.org/jira/browse/AXIS2-3177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rich Scheuerle resolved AXIS2-3177.
-----------------------------------
Resolution: Fixed
Committed 573327
> 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
> 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