Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-684

Passing a map literal to a macro call forbids altering the map in any way, while maps bound to an actual parameter may be changed

    Details

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

      Description

      For example, with the following macro:

      #macro(changeMap $map)
      Before: $map.someKey
      #set($map.someKey = 'new value')
      After: $map.someKey
      #end

      This call works as expected:

      #set($actualMap =

      {'someKey' : 'old value'}

      )
      #changeMap($actualMap) => old value, then new value

      But this one doesn't:

      #changeMap(

      {'someKey' : 'old value'}

      ) => old value, then again old value

        Attachments

          Activity

            People

            • Assignee:
              claude Claude Brisson
              Reporter:
              sdumitriu Sergiu Dumitriu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: