Velocity
  1. Velocity
  2. VELOCITY-759

NullPointerException in Foreach.java - PatchAvailable

    Details

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

      Description

      I checked out the code from http://svn.apache.org/repos/asf/velocity/engine/trunk/ I think this is version 1.6.x because it is listed on http://velocity.apache.org/download.cgi But I'm not sure.

      When I was playing with the Velocity Template Engine I got a NullPointerException. Maybe it is because of my unusual configuration that this exception didn't occured before to others. But in my opinion this kind of Exceptions may never occur.

      To be specific, the Exception is thrown on line 225 in Foreach.java
      if (!hasNextName.equals("velocityHasNext"))
      When the variable hasNextName equals null
      hasNextName is a deprecated config setting. It is assigned on line 210: hasNextName = rsvc.getString(RuntimeConstants.HAS_NEXT_NAME);

      The included patch makes it NullPointer save: if (!"velocityHasNext".equals(hasNextName))

        Activity

        Rachid created issue -
        Hide
        Rachid added a comment -

        This file patches two possible nullpointerexceptions

        Show
        Rachid added a comment - This file patches two possible nullpointerexceptions
        Rachid made changes -
        Field Original Value New Value
        Attachment NullPointer-Foreach.patch [ 12438813 ]
        Hide
        Nathan Bubna added a comment -

        Sure. Might as well...

        Show
        Nathan Bubna added a comment - Sure. Might as well...
        Nathan Bubna made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.7 [ 12313453 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12501839 ] Default workflow, editable Closed status [ 12551720 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551720 ] jira [ 12552261 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        13d 8h 55m 1 Nathan Bubna 28/Mar/10 22:36

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development