This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 73de6ca  Remove Threadlocal decimalFormatter on thread exit
73de6ca is described below

commit 73de6ca382b12e884a719d0ffd004f5e12ed03d8
Author: Felix Schumacher <[email protected]>
AuthorDate: Sat Aug 24 22:25:39 2019 +0200

    Remove Threadlocal decimalFormatter on thread exit
---
 .../org/apache/jmeter/assertions/JSONPathAssertion.java   | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git 
a/src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
 
b/src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
index 88ad21b..dc34ef9 100644
--- 
a/src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
+++ 
b/src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
@@ -23,6 +23,7 @@ import java.util.Map;
 
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.testelement.AbstractTestElement;
+import org.apache.jmeter.testelement.ThreadListener;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.oro.text.regex.Pattern;
 import org.slf4j.Logger;
@@ -38,9 +39,9 @@ import com.jayway.jsonpath.JsonPath;
  * previous sample result using JSON path expression
  * @since 4.0
  */
-public class JSONPathAssertion extends AbstractTestElement implements 
Serializable, Assertion {
+public class JSONPathAssertion extends AbstractTestElement implements 
Serializable, Assertion, ThreadListener {
     private static final Logger log = 
LoggerFactory.getLogger(JSONPathAssertion.class);
-    private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 2L;
     public static final String JSONPATH = "JSON_PATH";
     public static final String EXPECTEDVALUE = "EXPECTED_VALUE";
     public static final String JSONVALIDATION = "JSONVALIDATION";
@@ -217,4 +218,14 @@ public class JSONPathAssertion extends AbstractTestElement 
implements Serializab
         }
         return str;
     }
+
+    @Override
+    public void threadStarted() {
+        // nothing to do on thread start
+    }
+
+    @Override
+    public void threadFinished() {
+        decimalFormatter.remove();
+    }
 }

Reply via email to