$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


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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to