Author: fschumacher
Date: Mon Feb 12 12:19:38 2018
New Revision: 1823954

URL: http://svn.apache.org/viewvc?rev=1823954&view=rev
Log:
Use new ThreadLocal#withInitial. Part of (or rather hidden in) #358

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java

Modified: 
jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java?rev=1823954&r1=1823953&r2=1823954&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java 
Mon Feb 12 12:19:38 2018
@@ -25,12 +25,7 @@ import org.apache.jmeter.util.JMeterUtil
  * Keeps track of active and total thread counts.
  */
 public final class JMeterContextService {
-    private static final ThreadLocal<JMeterContext> threadContext = new 
ThreadLocal<JMeterContext>() {
-        @Override
-        public JMeterContext initialValue() {
-            return new JMeterContext();
-        }
-    };
+    private static final ThreadLocal<JMeterContext> threadContext = 
ThreadLocal.withInitial(JMeterContext::new);
 
     //@GuardedBy(JMeterContextService.class)
     private static long testStart = 0;


Reply via email to