IteratorTool not working with Velocity >1.4 #foreach
----------------------------------------------------
Key: VELTOOLS-137
URL: https://issues.apache.org/jira/browse/VELTOOLS-137
Project: Velocity Tools
Issue Type: Bug
Reporter: Herbert Poul
since the Foreach directive of velocity now calles hasNext() a second time the
IteratorTool fails - since calling hasNext() more than once simply flipps
'wantsMore' which seems kind of strange - the code:
$iter.hasNext() $iter.hasNext() $iter.hasNext()
will output: true false true
imo, hasNext() should always either return 'true' (if 'more()' was called since
the last 'next()' call) or always 'false'.
it should be easily fixable by not setting 'wantsMore' in hasNext(), but
setting it to false in next().
(i know IteratorTool is deprecated, but it would still be nice if wouldn't
completely fail after an velocity upgrade)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]