Bug 61659

Summary: JMeterVariables#get() should apply toString() on non string objects
Product: JMeter Reporter: Philippe Mouawad <p.mouawad>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Test plan failing

Description Philippe Mouawad 2017-10-24 10:58:08 UTC
Created attachment 35451 [details]
Test plan failing

Currently, whenever you store in a variable non string object using
vars.putObject("nbLoops", 1)

and getting it as ${"nbLoops"} in a LoopController for example will fail due to ClassCastException and a log will appear:
> java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

I feel this could be improved by calling toString() on variable value if it's not a String.
Comment 1 Philippe Mouawad 2017-10-24 11:08:06 UTC
Author: pmouawad
Date: Tue Oct 24 11:02:25 2017
New Revision: 1813168

URL: http://svn.apache.org/viewvc?rev=1813168&view=rev
Log:
Bug 61659 - JMeterVariables#get() should apply toString() on non string objects
Bugzilla Id: 61659

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterVariables.java
    jmeter/trunk/xdocs/changes.xml