Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-1839

Velocity macro parameter name can break passed parameter expression

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 12.0-rc-1
    • Fix Version/s: 12.0
    • Component/s: Velocity
    • Labels:
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Similar issues:

      Description

      You can reproduce with something like this:

      #set($test = $someObjectWithAGetNameMethodReturning_value)
      #set($other = $someObjectWithAGetNameMethodReturning_something)
      
      #macro (testMacro $test $name)
        $name
      #end
      
      $test.name
      
      #testMacro($other, $test.name)
      

      It's a regression in Velocity 2.2 reported on https://issues.apache.org/jira/browse/VELOCITY-904?focusedCommentId=17019574&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17019574

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tmortagne Thomas Mortagne
              Reporter:
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: