[ https://issues.apache.org/jira/browse/VELTOOLS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claude Brisson closed VELTOOLS-137. ----------------------------------- > 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 > Assignee: Claude Brisson > Priority: Major > > 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 was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org For additional commands, e-mail: dev-h...@velocity.apache.org