You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <de...@velocity.apache.org> on 2018/06/26 10:25:00 UTC

[jira] [Resolved] (VELTOOLS-137) IteratorTool not working with Velocity >1.4 #foreach

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

Claude Brisson resolved VELTOOLS-137.
-------------------------------------
    Resolution: Won't Fix
      Assignee: Claude Brisson

The IteratorTool has been dropped long ago.

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