Simon Urli commented on VELOCITY-926:

bq. Simon Urli I did not observe the behavior you mention, with or without 
velocimacro.arguments.preserve_literals set to true. You may want to provide me 
with a more circumstanced example, including the whole Velocity configuration. 
This behavior would be a serious bug.

Indeed sorry, I've been a bit fast on friday when trying to reproduce a local 
behaviour. So actually, I had the problem, because myMacro protected myvar from 
being empty, so the behaviour is actually:
#macro (myMacro $myvar)
  #if (!$myvar)
    #set($myvar = {})

#set ($myvar = "value")

We do have this kind of code in our codebase.

> Regression: Macro arguments names cannot collide with external references 
> names
> -------------------------------------------------------------------------------
>                 Key: VELOCITY-926
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-926
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.0, 2.1
>            Reporter: Claude Brisson
>            Assignee: Claude Brisson
>            Priority: Major
>             Fix For: 2.2
> Consider the following example:
> {code}
> #macro( test $foo $bar )
>   $foo $bar
> #end
> #set($foo = 'foo')
> #set($bar = 'bar')
> #test( $bar, $foo )
> {code}
> The expected result would be "{{bar foo}}", but since 2.0 we get the 
> incorrect result "{{bar bar}}", as if the first inner {{$foo}} macro argument 
> was overwritting the second argument evaluation.

This message was sent by Atlassian Jira

To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to