You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <ji...@apache.org> on 2016/09/21 21:40:20 UTC
[jira] [Resolved] (VELOCITY-684) Passing a map literal to a macro
call forbids altering the map in any way, while maps bound to an actual
parameter may be changed
[ https://issues.apache.org/jira/browse/VELOCITY-684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claude Brisson resolved VELOCITY-684.
-------------------------------------
Resolution: Fixed
Assignee: Claude Brisson
Fix Version/s: 2.x
Fixed by the patch from VELOCITY-841 (commit 1753788).
> Passing a map literal to a macro call forbids altering the map in any way, while maps bound to an actual parameter may be changed
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: VELOCITY-684
> URL: https://issues.apache.org/jira/browse/VELOCITY-684
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.1
> Reporter: Sergiu Dumitriu
> Assignee: Claude Brisson
> Fix For: 2.x
>
>
> For example, with the following macro:
> #macro(changeMap $map)
> Before: $map.someKey
> #set($map.someKey = 'new value')
> After: $map.someKey
> #end
> This call works as expected:
> #set($actualMap = {'someKey' : 'old value'})
> #changeMap($actualMap) => old value, then new value
> But this one doesn't:
> #changeMap({'someKey' : 'old value'}) => old value, then again old value
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org