[jira] [Commented] (VELOCITY-926) Regression: Macro arguments names cannot collide with external references names

2020-01-28 Thread Thomas Mortagne (Jira)


[ 
https://issues.apache.org/jira/browse/VELOCITY-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17025402#comment-17025402
 ] 

Thomas Mortagne commented on VELOCITY-926:
--

bq. We'll know more about kind of expected but not directly tested ones after 
all XWiki integration tests are executed in a couple of hours.

Looks OK on that front too from what we can see. Well done :)

> 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: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



[jira] [Commented] (VELOCITY-926) Regression: Macro arguments names cannot collide with external references names

2020-01-28 Thread Thomas Mortagne (Jira)


[ 
https://issues.apache.org/jira/browse/VELOCITY-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17025068#comment-17025068
 ] 

Thomas Mortagne commented on VELOCITY-926:
--

Looks good for the tested expected Velocity behaviors (AKA 
xwiki-commons-velocity unit tests). We'll know more about kind of expected but 
not directly tested ones after all XWiki integration tests are executed in a 
couple of hours.

> 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: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



[jira] [Commented] (VELOCITY-926) Regression: Macro arguments names cannot collide with external references names

2020-01-28 Thread Claude Brisson (Jira)


[ 
https://issues.apache.org/jira/browse/VELOCITY-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17025036#comment-17025036
 ] 

Claude Brisson commented on VELOCITY-926:
-

[~tmortagne], would you be kind enough to test this snapshot version before I 
push out the RC? Thanks.


> 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: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



[jira] [Resolved] (VELOCITY-926) Regression: Macro arguments names cannot collide with external references names

2020-01-28 Thread Claude Brisson (Jira)


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

Claude Brisson resolved VELOCITY-926.
-
Resolution: Fixed

Fixed by commit 1873244.

Deprecate velocimacro.arguments.preserve_literals in favor of the new 
{{velocimacro.enable_bc_mode flag,
which mimics 1.7 velocimacro behavior:

- preserve arguments literals:

#macro(m $arg) $arg #end
m($null)

will displays $arg w/o bc mode and $null with bc mode

- use global defaults for missing arguments:

#macro(m $foo) $foo #end
#set($foo='foo')
#m()

will display $foo w/o bc mode and 'foo' with bc mode

The following use cases have been left aside from backward compatibility:

- preserving local macro scope values

#macro(test) #set($foo = 'foo') 
$some_tool.change_foo_value_in_global_context_to_bar() $foo #end
#test()

will always display 'bar', while 1.7 displayed 'foo'

- setting a null argument to null, while argument name exists in context, 

#macro(setnull $foo) #set($foo = $null) #end
#set($foo='foo')
#setnull($null)
$foo

Will always display 'foo' (w or w/o bc mode), while 1.7 did display $foo


> 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: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org