Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-379

foreach should generalise for Iterable, not just Collection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • Bugzilla Id:
      34921

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              henning Henning Schmiedehausen
              Reporter:
              dblaikie@ug.cs.usyd.edu.au David Blaikie
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: