You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Ruwan Linton (JIRA)" <ji...@apache.org> on 2008/05/08 07:02:55 UTC

[jira] Resolved: (SYNAPSE-295) The clonePartially() method of org.apache.synapse.util.MessageHelper does not copy properties.

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

Ruwan Linton resolved SYNAPSE-295.
----------------------------------

    Resolution: Fixed

Fixed in the SVN trunk, Thanks Rod for finding this out

> The clonePartially() method of org.apache.synapse.util.MessageHelper does not copy properties.
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-295
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-295
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1
>         Environment: Windows XP
>            Reporter: Rod Burgett
>            Assignee: Ruwan Linton
>             Fix For: 1.2
>
>
> The clonePartially() method of org.apache.synapse.util.MessageHelper does not copy properties to the new MessageContext.  The for-loop that walks through 'ori.getProperties().keySet()' should be replaced with a while loop over the Iterator returned by 'ori.getPropertyNames()'.
> You might expect these two iterations to be identical, especially when you see that 'getPropertyNames()' returns 'properties.keySet().iterator()'.  But it's not that simple.  The Axis2 MessageContext class extends AbstractContext and overrides 'getProperties()' with an implementation that doesn't actually use the properties map.  So, 'getProperties()' and 'getPropertyNames()' work from two different underlying maps.
> The assertion in this code fragment will fail:
> String key = "propKey";
> MessageContext origMc = new MessageContext();
> origMc.setProperty( key, "propValue" );
> MessageContext newMc = MessageHelper.clonePartially( origMc );
> Object result = newMc.getProperty( key );
> assert( result != null );

-- 
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: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org