[ 
https://issues.apache.org/jira/browse/VELOCITY-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530183
 ] 

Nathan Bubna commented on VELOCITY-379:
---------------------------------------

This was re-resolved by having #foreach fall back to looking for an iterator() 
method when it can't figure out another way to get an iterator from the 
reference.  This is backwards compatible and supports the JDK 5 Iterable 
interface.

See VELOCITY-443 and revision 579331 for more info.

> foreach should generalise for Iterable, not just Collection
> -----------------------------------------------------------
>
>                 Key: VELOCITY-379
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-379
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>         Environment: Operating System: All
> Platform: All
>            Reporter: David Blaikie
>            Assignee: Henning Schmiedehausen
>             Fix For: 1.5
>
>
> As of Java 1.5 the java.lang.Iterable interface is the general contract that
> should be used when looking for things that provide Iterators. This allows for
> user defined non collection types to be generally usable by things that just
> need iteration such as the Java Language's for(X x : y) looping construct and
> seems perfectly applicable to the velocity Foreach directive. 
> I'm not sure of the versioning policy (which java version) of Velocity so if 
> you
> are deliberately not creating a 1.5 dependency then this is not a 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