Velocity
  1. Velocity
  2. VELOCITY-800

Subsequent invalid references cannot be resolved by InvalidReferenceEventHandler.invalidGetMethod

    Details

      Description

      If $foo is a java.lang.String and a template tried to do $foo.bar, one can use an InvalidReferenceEventHandler to resolve bar into a value. However, if the template tries to do $foo.bar.baz, the last part cannot be resolved using an InvalidReferenceEventHandler. I'll attach an example test case.

      1. SubsequentInvalidReferenceEventHandlerTest.java
        2 kB
        Quintin Siebers
      2. VELOCITY-800.patch
        7 kB
        Peter-Paul Kruijsen

        Activity

        Hide
        Peter-Paul Kruijsen added a comment -

        I've created a patch that could resolve this issue. It moves the result null check and invalidMethod / invalidGetMethod invocation from after to within the children loop. It also adds the test case attached by the reporter.

        Show
        Peter-Paul Kruijsen added a comment - I've created a patch that could resolve this issue. It moves the result null check and invalidMethod / invalidGetMethod invocation from after to within the children loop. It also adds the test case attached by the reporter.

          People

          • Assignee:
            Unassigned
            Reporter:
            Quintin Siebers
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development