Velocity
  1. Velocity
  2. VELOCITY-627

#foreach exception reports wrong line number

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      With the velocity configuration property 'directive.foreach.skip.invalid' set to false, the following VTL:

      #set($x = "abc")
      #foreach($i in $x)
      blaa
      #end

      Creates the exception:

      Uberspect returned a null iterator for #foreach at /foo.vm [line 0, column 0]. $x (abc) is either of wrong type or has an invalid iterator() implementation

      Which contains the wrong line and column numbers.

      1. fix627.patch
        4 kB
        Byron Foster

        Activity

        Byron Foster created issue -
        Hide
        Byron Foster added a comment -

        the patch is a fix for this problem, and actually it fixes the line and column number of all directives. It also contains a TestCase.

        Show
        Byron Foster added a comment - the patch is a fix for this problem, and actually it fixes the line and column number of all directives. It also contains a TestCase.
        Byron Foster made changes -
        Field Original Value New Value
        Attachment fix627.patch [ 12391981 ]
        Hide
        Nathan Bubna added a comment -

        thanks, Byron!

        Show
        Nathan Bubna added a comment - thanks, Byron!
        Nathan Bubna made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.6 [ 12310290 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Mark Thomas made changes -
        Workflow jira [ 12443974 ] Default workflow, editable Closed status [ 12551581 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551581 ] jira [ 12552466 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        18h 52m 1 Nathan Bubna 13/Oct/08 18:45

          People

          • Assignee:
            Unassigned
            Reporter:
            Byron Foster
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development