Velocity
  1. Velocity
  2. VELOCITY-717

Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.x, 1.7
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Suse Linux

      Description

      The Engine throws an NPE if the IncludeEventHandler returns null.
      (using merge method with a list of macro libs)

      java.lang.NullPointerException
      >> at java.util.Hashtable.get(Hashtable.java:333)
      >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
      >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
      >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
      >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
      >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
      >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
      >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      >> at org.apache.velocity.Template.merge(Template.java:328)

      1. Velocity717TestCase.java
        3 kB
        Jarkko Viinamäki
      2. test8.vm
        0.1 kB
        Jarkko Viinamäki
      3. macros2.vm
        0.0 kB
        Jarkko Viinamäki

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551705 ] jira [ 12552253 ]
        Mark Thomas made changes -
        Workflow jira [ 12463614 ] Default workflow, editable Closed status [ 12551705 ]
        Nathan Bubna made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Will Glass-Husain [ wglass ]
        Fix Version/s 1.6.x [ 12314172 ]
        Resolution Fixed [ 1 ]
        Jarkko Viinamäki made changes -
        Attachment macros2.vm [ 12442307 ]
        Jarkko Viinamäki made changes -
        Attachment test8.vm [ 12442306 ]
        Jarkko Viinamäki made changes -
        Attachment Velocity717TestCase.java [ 12442305 ]
        Will Glass-Husain made changes -
        Resolution Cannot Reproduce [ 5 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Will Glass-Husain [ wglass ]
        Will Glass-Husain made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Will Glass-Husain made changes -
        Fix Version/s 1.7 [ 12313453 ]
        Johann Weber made changes -
        Field Original Value New Value
        Environment Suse Linux
        Description The Engine throws an NPE if the IncludeEventHandler returns null.
        (using merge method with a list of macro libs)

         java.lang.NullPointerException
        >> at java.util.Hashtable.get(Hashtable.java:333)
        >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
        >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
        >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
        >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
        >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
        >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
        >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
        >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
        >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        >> at org.apache.velocity.Template.merge(Template.java:328)
        Johann Weber created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Johann Weber
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development