[
https://issues.apache.org/jira/browse/VELOCITY-565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528180
]
Will Glass-Husain commented on VELOCITY-565:
--------------------------------------------
Etienne--
Awesome! A bug report and a patch! Appreciate the contribution.
I'll commit this ASAP if your patch has three things
--> a change to the unit test that (ideally) breaks before the patch and is
fixed after
--> all the changes (and unit test) is submitted in 'svn diff' format
--> you verbally assure me that you ran 'ant test' and everything passed.
Regarding the diff format-- it's easy. Just checkout the latest trunk code
from subversion. Make your changes. Go to the root directory and type "svn
diff" and capture the output. That should capture in one file the code change
and the unit test change.
If you don't have time to do those things, we still appreciate your effort, but
it may be a while until I have time to work through the issue and verify the
patch works but doesn't break anything else.
> EvaluateContext does not take account of inner.localContext
> -----------------------------------------------------------
>
> Key: VELOCITY-565
> URL: https://issues.apache.org/jira/browse/VELOCITY-565
> Project: Velocity
> Issue Type: Bug
> Reporter: Will Glass-Husain
> Assignee: Will Glass-Husain
> Priority: Minor
> Fix For: 1.6
>
> Attachments: EvaluateContext.java
>
>
> the following vtl does not render what is, IMHO, expected :
> #macro(testEval $expr)
> #foreach($value in ["val1", "val2"])
> value is : #evaluate( $expr )
> #end
> #end
> #testEval( "${value}" )
> renders :
> value is : ${value}
> value is : ${value}
> The reason is that EvaluateContext ctor assigns 'inner.getBaseContext()'
> to instance variable 'innerContext', and getBaseContext() does not
> return VMContext localContext refs (of the #foreach directive).
> Changing the EvaluateContext ctor so that 'innerContext' is set to
> 'inner' allow velocity to render the right result :
> value is : val1
> value is : val2
> But I'm not sure this would be a correct fix, should the VMContext
> return all current refs ? Could you tell me what the normal behavior is
> and what is the way all that stuff sould work ?
> Etienne Massip
--
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]