[
https://issues.apache.org/jira/browse/VELOCITY-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023269#comment-17023269
]
Claude Brisson commented on VELOCITY-926:
-----------------------------------------
[~surli] 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.
[~tmortagne] Yes, any change affects backward compatibility. But when they
concern ill-formed constructs, like expecting the global value of a reference
to magically become a default value for a missing argument, we can question the
decision to provide backward compatibility. That's why I was asking for a
specific use case where this behavior would be useful, as opposed to just
supposing that it could perhaps break something somewhere. Again, since we're
*not* passing the argument, there is a strong logic in the fact that it remains
null inside the macro.
> 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
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]