Velocity
  1. Velocity
  2. VELOCITY-681

[regression] Changes on the macro parameters are not persisted outside the macro call

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.6.2
    • Component/s: Engine
    • Labels:
      None

      Description

      The fix for VELOCITY-615 was too radical, since it completely disables #setting new values to the formal arguments. A minimalistic example that used to work up to 1.6 (but not with 1.6.1) is:

      
      

      #macro(myMacro $result)
      #set($result = 'some value')
      #end
      #myMacro($x)
      $x

      {/noformat}

      which prints $x (as an undefined variable).

      1. VELOCITY-681-1.6.patch
        15 kB
        Sergiu Dumitriu
      2. VELOCITY-681-trunk.patch
        16 kB
        Sergiu Dumitriu

        Issue Links

          Activity

          Sergiu Dumitriu created issue -
          Sergiu Dumitriu made changes -
          Field Original Value New Value
          Attachment VELOCITY-681-1.6.patch [ 12398522 ]
          Sergiu Dumitriu made changes -
          Attachment VELOCITY-681-trunk.patch [ 12398523 ]
          Sergiu Dumitriu made changes -
          Link This issue relates to VELOCITY-615 [ VELOCITY-615 ]
          Sergiu Dumitriu made changes -
          Description The fix for VELOCITY-615 was too radical, since it completely disables #setting new values to the formal arguments. A minimalistic example that used to work up until 1.6 is:

          {noformat}
          #macro(myMacro $result)
            #set($result = 'some value')
          #end
          #myMacro($x)
          $x
          {/noformat}
          which prints $x (as an undefined variable).
          The fix for VELOCITY-615 was too radical, since it completely disables #setting new values to the formal arguments. A minimalistic example that used to work up to 1.6 (but not with 1.6.1) is:

          {noformat}
          #macro(myMacro $result)
            #set($result = 'some value')
          #end
          #myMacro($x)
          $x
          {/noformat}
          which prints $x (as an undefined variable).
          Nathan Bubna made changes -
          Fix Version/s 1.7 [ 12313453 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Nathan Bubna made changes -
          Comment [ [flights|http://getflightsto.com]
          [baby names|http://childcareforums.com]
          ]
          Nathan Bubna made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Workflow jira [ 12450865 ] Default workflow, editable Closed status [ 12551679 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12551679 ] jira [ 12552553 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Sergiu Dumitriu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development