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

Martin Schwaiger updated VELOCITY-655:
--------------------------------------

    Description: 
I've found a problem when changing parameter values inside a macro using 
velocity engine version 1.6.

In my use case I have to lower the input string first and then do further 
processing.

With version 1.5 of the velocity engine there were no problems to implement 
this use case.

Here is an example which shows the difference between version 1.5 and 1.6:

Template-Code:
{code}
#macro(testMacro $x)
#set ($x = $x.toLowerCase())
#set ($y = $x.toLowerCase())
x=$x
y=$y
#end
#testMacro('ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase1')
#testMacro("ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase2")
{code}

Result with Velocity Engine 1.5:
x=abcdefghijklmnopqrstuvwxyz-testcase1
y=abcdefghijklmnopqrstuvwxyz-testcase1
x=abcdefghijklmnopqrstuvwxyz-testcase2
y=abcdefghijklmnopqrstuvwxyz-testcase2

Result with Velocity Engine 1.6:
x=ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase1
y=abcdefghijklmnopqrstuvwxyz-testcase1
x=ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase2
y=abcdefghijklmnopqrstuvwxyz-testcase2


  was:
I've found a problem when changing parameter values inside a macro using 
velocity engine version 1.6.

In my use case I have to lower the input string first and then do further 
processing.

With version 1.5 of the velocity engine there were no problems to implement 
this use case.

Here is an example which shows the difference between version 1.5 and 1.6:

Template-Code:
{code}
#macro(testMacro $x)
#set ($x = $x.toLowerCase())
#set ($y = $x.toLowerCase())
x=$x
y=$y
#end

#testMacro('ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase1')
#testMacro("ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase2")
{code}

Result with Velocity Engine 1.5:
x=abcdefghijklmnopqrstuvwxyz-testcase1
y=abcdefghijklmnopqrstuvwxyz-testcase1
x=abcdefghijklmnopqrstuvwxyz-testcase2
y=abcdefghijklmnopqrstuvwxyz-testcase2

Result with Velocity Engine 1.6:
x=ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase1
y=abcdefghijklmnopqrstuvwxyz-testcase1
x=ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase2
y=abcdefghijklmnopqrstuvwxyz-testcase2



> Macro parameter value can't be changed inside a macro
> -----------------------------------------------------
>
>                 Key: VELOCITY-655
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-655
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Martin Schwaiger
>
> I've found a problem when changing parameter values inside a macro using 
> velocity engine version 1.6.
> In my use case I have to lower the input string first and then do further 
> processing.
> With version 1.5 of the velocity engine there were no problems to implement 
> this use case.
> Here is an example which shows the difference between version 1.5 and 1.6:
> Template-Code:
> {code}
> #macro(testMacro $x)
> #set ($x = $x.toLowerCase())
> #set ($y = $x.toLowerCase())
> x=$x
> y=$y
> #end
> #testMacro('ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase1')
> #testMacro("ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase2")
> {code}
> Result with Velocity Engine 1.5:
> x=abcdefghijklmnopqrstuvwxyz-testcase1
> y=abcdefghijklmnopqrstuvwxyz-testcase1
> x=abcdefghijklmnopqrstuvwxyz-testcase2
> y=abcdefghijklmnopqrstuvwxyz-testcase2
> Result with Velocity Engine 1.6:
> x=ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase1
> y=abcdefghijklmnopqrstuvwxyz-testcase1
> x=ABCDEFGHIJKLMNOPQRSTUVWXYZ-Testcase2
> y=abcdefghijklmnopqrstuvwxyz-testcase2

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to