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

        Hide
        Nathan Bubna added a comment -

        thanks, Byron!

        Show
        Nathan Bubna added a comment - thanks, Byron!
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development