https://bz.apache.org/bugzilla/show_bug.cgi?id=64198

            Bug ID: 64198
           Summary: Spaces at the end of ${...}
           Product: JMeter
           Version: 5.2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER_6.0.0

When JMeter evaluates an expression like "${__groovy(true) }" it will throw an
exception like:

rg.apache.jmeter.functions.InvalidVariableException: Expected } after __groovy
function call in ${__groovy(true) }
        at
org.apache.jmeter.engine.util.FunctionParser.makeFunction(FunctionParser.java:135)
~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at
org.apache.jmeter.engine.util.FunctionParser.compileString(FunctionParser.java:78)
~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at
org.apache.jmeter.engine.util.CompoundVariable.setParameters(CompoundVariable.java:180)
~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at
org.apache.jmeter.engine.util.ReplaceStringWithFunctions.transformValue(ReplaceStringWithFunctions.java:42)
~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at
org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:169)
~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at
org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:79)
~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at org.apache.jmeter.engine.PreCompiler.addNode(PreCompiler.java:88)
[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at
org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:993)
[jorphan.jar:5.3-SNAPSHOT]
        at
org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994)
[jorphan.jar:5.3-SNAPSHOT]
        at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:976)
[jorphan.jar:5.3-SNAPSHOT]
        at
org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:361)
[ApacheJMeter_core.jar:5.3-SNAPSHOT]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]

If the expression is used without the space before the closing brace like
"${__groovy(true)}" it works as expected.

I think that we should be more forgiving here and ignore spaces before the
closing brace.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to