Velocity
  1. Velocity
  2. VELOCITY-71

False positive error condition parsing VM_global_library.vm

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3-rc1
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: Other

      Description

      This bug is actually against 1.3 RC1, but there is no Version listing for that
      in the Bugzilla config.

      The initial parsing of the global Velocimacro library is incorrectly indicating
      an error when context variables which are not passed in as arguments to a macro
      are used when calling one macro within the body of another. Confusing, eh? I
      assume that this could be worked around by putting double quotes around the
      supposedly non-existent arguments to the invoked macro, but was wondering if
      this was a bug. Included is a sample problem case and some log output.

      From VM_global_library.vm:

      #macro(linkedLoginName $acl $user)
      #linkIf($user.isEditableBy($acl) $currentDomain.getProjectPageURL("UserEdit",
      "userID=$user.getID()") $user.getLoginName())
      #end

      #macro(linkIf $condition $link $text)
      #if ($condition) <a href="$link">$text</a> #else $text #end
      #end

      From velocity.log:

      2002-05-01 15:04:28,496 - Velocimacro : added new VM : #enterHelp( filename
      linktext ) : source = VM_global_library.vm
      2002-05-01 15:04:28,843 - VM #linkIf: error : too few arguments to macro. Wanted
      3 got 0
      2002-05-01 15:04:28,847 - VM #servletLink: error : too few arguments to macro.
      Wanted 2 got 0
      2002-05-01 15:04:28,848 - VM #servletLink: error : too few arguments to macro.
      Wanted 2 got 0
      2002-05-01 15:04:28,849 - VM #servletLink: error : too few arguments to macro.
      Wanted 2 got 0
      2002-05-01 15:04:28,857 - VM #displayProjectTreeAsOptions: error : too few
      arguments to macro. Wanted 4 got 0
      2002-05-01 15:04:28,907 - VM #selectYear: error : too few arguments to macro.
      Wanted 2 got 0
      2002-05-01 15:04:28,907 - VM #selectMonth: error : too few arguments to macro.
      Wanted 1 got 0
      2002-05-01 15:04:28,908 - VM #selectDay: error : too few arguments to macro.
      Wanted 1 got 0
      2002-05-01 15:04:29,109 - ResourceManager : found VM_global_library.vm with
      loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
      2002-05-01 15:04:29,113 - Velocimacro : VM library template macro registration
      complete.
      2002-05-01 15:04:29,113 - Velocimacro : allowInline = true : VMs can be defined
      inline in templates

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1622d 16h 29m 1 Henning Schmiedehausen 10/Oct/06 23:53
          Resolved Resolved Closed Closed
          148d 1h 10m 1 Henning Schmiedehausen 08/Mar/07 00:04
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12551867 ] jira [ 12552302 ]
          Mark Thomas made changes -
          Workflow jira [ 12324946 ] Default workflow, editable Closed status [ 12551867 ]
          Henning Schmiedehausen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Henning Schmiedehausen added a comment -

          Close all resolved issues for Engine 1.5 release.

          Show
          Henning Schmiedehausen added a comment - Close all resolved issues for Engine 1.5 release.
          Henning Schmiedehausen made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Hide
          Henning Schmiedehausen added a comment -

          This is more of a reporting issue than an actual but. Fixed in 1.5.

          Show
          Henning Schmiedehausen added a comment - This is more of a reporting issue than an actual but. Fixed in 1.5.
          Hide
          Daniel Rall added a comment -

          This issue still existed in the HEAD of trunk after 1.4 was released.

          Show
          Daniel Rall added a comment - This issue still existed in the HEAD of trunk after 1.4 was released.
          Nathan Bubna made changes -
          Link This issue is duplicated by VELOCITY-108 [ VELOCITY-108 ]
          Will Glass-Husain made changes -
          Bugzilla Id 8716
          Affects Version/s 1.3-rc1 [ 12310248 ]
          Affects Version/s 1.0-Release [ 12310243 ]
          Will Glass-Husain made changes -
          Bugzilla Id 8716
          Priority Major [ 3 ] Minor [ 4 ]
          Will Glass-Husain made changes -
          Bugzilla Id 8716
          Environment Operating System: Linux
          Platform: Other
          Operating System: Linux
          Platform: Other
          Fix Version/s 1.5 [ 12310253 ]
          Assignee Velocity-Dev List [ velocity-dev@jakarta.apache.org ]
          Description This bug is actually against 1.3 RC1, but there is no Version listing for that
          in the Bugzilla config.

          The initial parsing of the global Velocimacro library is incorrectly indicating
          an error when context variables which are not passed in as arguments to a macro
          are used when calling one macro within the body of another. Confusing, eh? I
          assume that this could be worked around by putting double quotes around the
          supposedly non-existent arguments to the invoked macro, but was wondering if
          this was a bug. Included is a sample problem case and some log output.

          From VM_global_library.vm:

          #macro(linkedLoginName $acl $user)
           #linkIf($user.isEditableBy($acl) $currentDomain.getProjectPageURL("UserEdit",
          "userID=$user.getID()") $user.getLoginName())
          #end

          #macro(linkIf $condition $link $text)
           #if ($condition) <a href="$link">$text</a> #else $text #end
          #end

          From velocity.log:

          2002-05-01 15:04:28,496 - Velocimacro : added new VM : #enterHelp( filename
          linktext ) : source = VM_global_library.vm
          2002-05-01 15:04:28,843 - VM #linkIf: error : too few arguments to macro. Wanted
          3 got 0
          2002-05-01 15:04:28,847 - VM #servletLink: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,848 - VM #servletLink: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,849 - VM #servletLink: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,857 - VM #displayProjectTreeAsOptions: error : too few
          arguments to macro. Wanted 4 got 0
          2002-05-01 15:04:28,907 - VM #selectYear: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,907 - VM #selectMonth: error : too few arguments to macro.
          Wanted 1 got 0
          2002-05-01 15:04:28,908 - VM #selectDay: error : too few arguments to macro.
          Wanted 1 got 0
          2002-05-01 15:04:29,109 - ResourceManager : found VM_global_library.vm with
          loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
          2002-05-01 15:04:29,113 - Velocimacro : VM library template macro registration
          complete.
          2002-05-01 15:04:29,113 - Velocimacro : allowInline = true : VMs can be defined
          inline in templates
          This bug is actually against 1.3 RC1, but there is no Version listing for that
          in the Bugzilla config.

          The initial parsing of the global Velocimacro library is incorrectly indicating
          an error when context variables which are not passed in as arguments to a macro
          are used when calling one macro within the body of another. Confusing, eh? I
          assume that this could be worked around by putting double quotes around the
          supposedly non-existent arguments to the invoked macro, but was wondering if
          this was a bug. Included is a sample problem case and some log output.

          From VM_global_library.vm:

          #macro(linkedLoginName $acl $user)
           #linkIf($user.isEditableBy($acl) $currentDomain.getProjectPageURL("UserEdit",
          "userID=$user.getID()") $user.getLoginName())
          #end

          #macro(linkIf $condition $link $text)
           #if ($condition) <a href="$link">$text</a> #else $text #end
          #end

          From velocity.log:

          2002-05-01 15:04:28,496 - Velocimacro : added new VM : #enterHelp( filename
          linktext ) : source = VM_global_library.vm
          2002-05-01 15:04:28,843 - VM #linkIf: error : too few arguments to macro. Wanted
          3 got 0
          2002-05-01 15:04:28,847 - VM #servletLink: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,848 - VM #servletLink: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,849 - VM #servletLink: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,857 - VM #displayProjectTreeAsOptions: error : too few
          arguments to macro. Wanted 4 got 0
          2002-05-01 15:04:28,907 - VM #selectYear: error : too few arguments to macro.
          Wanted 2 got 0
          2002-05-01 15:04:28,907 - VM #selectMonth: error : too few arguments to macro.
          Wanted 1 got 0
          2002-05-01 15:04:28,908 - VM #selectDay: error : too few arguments to macro.
          Wanted 1 got 0
          2002-05-01 15:04:29,109 - ResourceManager : found VM_global_library.vm with
          loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
          2002-05-01 15:04:29,113 - Velocimacro : VM library template macro registration
          complete.
          2002-05-01 15:04:29,113 - Velocimacro : allowInline = true : VMs can be defined
          inline in templates
          Hide
          Will Glass-Husain added a comment -

          It'd be nice to fix this for 1.5 release

          Show
          Will Glass-Husain added a comment - It'd be nice to fix this for 1.5 release
          Jeff Turner made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 8716 12314941
          Hide
          Geir Magnusson Jr added a comment -

          ack.

          Show
          Geir Magnusson Jr added a comment - ack.
          Hide
          Geir Magnusson Jr added a comment -

          ack. quite the description

          Show
          Geir Magnusson Jr added a comment - ack. quite the description
          Daniel Rall created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Daniel Rall
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development