You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Erling Molde (JIRA)" <ji...@apache.org> on 2010/02/17 17:03:27 UTC

[jira] Created: (WW-3385) (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value

(Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value
-------------------------------------------------------------------------------------------------------

                 Key: WW-3385
                 URL: https://issues.apache.org/jira/browse/WW-3385
             Project: Struts 2
          Issue Type: Improvement
          Components: Dispatch Filter
    Affects Versions: 2.1.8.1
            Reporter: Erling Molde
            Priority: Trivial


Noticed that the Map-wrapper classes (org.apache.struts2.dispatcher.RequestMap etc.) returns the new value from put-method.

request.setAttribute(key.toString(), value);
return get(key);

Should be:

V value = get(key);
request.setAttribute(key.toString(), value);
return value;

in order to be consistent with other Map-implementations.

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


[jira] Commented: (WW-3385) (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value

Posted by "Erling Molde (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834981#action_12834981 ] 

Erling Molde commented on WW-3385:
----------------------------------

Ooops! Blunder!

Yes, you're quite right. That's what I meant.

> (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3385
>                 URL: https://issues.apache.org/jira/browse/WW-3385
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch Filter
>    Affects Versions: 2.1.8.1
>            Reporter: Erling Molde
>            Assignee: Lukasz Lenart
>            Priority: Trivial
>
> Noticed that the Map-wrapper classes (org.apache.struts2.dispatcher.RequestMap etc.) returns the new value from put-method.
> request.setAttribute(key.toString(), value);
> return get(key);
> Should be:
> V value = get(key);
> request.setAttribute(key.toString(), value);
> return value;
> in order to be consistent with other Map-implementations.

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


[jira] Commented: (WW-3385) (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value

Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834831#action_12834831 ] 

Lukasz Lenart commented on WW-3385:
-----------------------------------

You mean

V oldValue = get(key);
request.setAttribute(value);
return oldValue;

?

> (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3385
>                 URL: https://issues.apache.org/jira/browse/WW-3385
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch Filter
>    Affects Versions: 2.1.8.1
>            Reporter: Erling Molde
>            Priority: Trivial
>
> Noticed that the Map-wrapper classes (org.apache.struts2.dispatcher.RequestMap etc.) returns the new value from put-method.
> request.setAttribute(key.toString(), value);
> return get(key);
> Should be:
> V value = get(key);
> request.setAttribute(key.toString(), value);
> return value;
> in order to be consistent with other Map-implementations.

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


[jira] Assigned: (WW-3385) (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value

Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart reassigned WW-3385:
---------------------------------

    Assignee: Lukasz Lenart

> (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3385
>                 URL: https://issues.apache.org/jira/browse/WW-3385
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch Filter
>    Affects Versions: 2.1.8.1
>            Reporter: Erling Molde
>            Assignee: Lukasz Lenart
>            Priority: Trivial
>
> Noticed that the Map-wrapper classes (org.apache.struts2.dispatcher.RequestMap etc.) returns the new value from put-method.
> request.setAttribute(key.toString(), value);
> return get(key);
> Should be:
> V value = get(key);
> request.setAttribute(key.toString(), value);
> return value;
> in order to be consistent with other Map-implementations.

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


[jira] Resolved: (WW-3385) (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value

Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-3385.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0

Done, changes committed, revision 911389

> (Application|Session|Request)Map.put(key,value) breaks Map-contract, returning new value, not old value
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3385
>                 URL: https://issues.apache.org/jira/browse/WW-3385
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch Filter
>    Affects Versions: 2.1.8.1
>            Reporter: Erling Molde
>            Assignee: Lukasz Lenart
>            Priority: Trivial
>             Fix For: 2.2.0
>
>
> Noticed that the Map-wrapper classes (org.apache.struts2.dispatcher.RequestMap etc.) returns the new value from put-method.
> request.setAttribute(key.toString(), value);
> return get(key);
> Should be:
> V value = get(key);
> request.setAttribute(key.toString(), value);
> return value;
> in order to be consistent with other Map-implementations.

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