Velocity
  1. Velocity
  2. VELOCITY-727

ArrayIndexOutOfBoundsException when #define without parameter

    Details

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

      Description

      #define()
      Hello 
      #end
      

      Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
      at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
      at org.apache.velocity.runtime.directive.Define.init(Define.java:96)
      at org.apache.velocity.runtime.parser.node.ASTDirective.init(ASTDirective.java:125)
      at org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:303)
      at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1254)
      at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java

      1. velocity-727.patch
        3 kB
        Jarkko Viinamäki

        Activity

        Hide
        Nathan Bubna added a comment -

        Just to make sure you know, you can't use #define without a name argument for the block you are defining.

        What were you hoping/expecting to happen? A better error message? That's a fine idea, but that hardly qualifies as a "Major" bug.

        Show
        Nathan Bubna added a comment - Just to make sure you know, you can't use #define without a name argument for the block you are defining. What were you hoping/expecting to happen? A better error message? That's a fine idea, but that hardly qualifies as a "Major" bug.
        Hide
        Siri C. added a comment -

        Yes, please improve an error message.
        Because we can't find a position of error on template code.

        Show
        Siri C. added a comment - Yes, please improve an error message. Because we can't find a position of error on template code.
        Hide
        Jarkko Viinamäki added a comment -

        This should fix it.

        Show
        Jarkko Viinamäki added a comment - This should fix it.
        Hide
        Nathan Bubna added a comment -

        Thanks, again!

        Show
        Nathan Bubna added a comment - Thanks, again!

          People

          • Assignee:
            Unassigned
            Reporter:
            Siri C.
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development