You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org> on 2008/12/28 19:53:44 UTC

[jira] Reopened: (VELOCITY-658) $velocityHasNext does not work in nested loops

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

Jarkko Viinamäki reopened VELOCITY-658:
---------------------------------------


> $velocityHasNext does not work in nested loops
> ----------------------------------------------
>
>                 Key: VELOCITY-658
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-658
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6, 1.6.1
>            Reporter: Jarkko Viinamäki
>            Priority: Minor
>             Fix For: 1.7
>
>         Attachments: velocity-hasNext-bug.patch
>
>
> With this test case:
> assertEvalEquals("test1 (a1;a2;a3)-test2 (a1;a2;a3)-test3 (a1;a2;a3)-test4 (a1;a2;a3)", 
>     "#foreach ($value in $list)$value (#foreach ($val in $list2)$val#if( $velocityHasNext );#end#end)#if( $velocityHasNext )-#end#end");             
> Velocity 1.6.1 (or current head) fails because the "hasNext" flag status of the outer foreach loop gets overwritten by the nested foreach loop. To fix this we need to save the status of the hasNext flag in Foreach directive just like we save the value of the counter.
> This bug is related to VELOCITY-657 but is a separate bug. 

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