jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1855928 - /jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
Date Wed, 20 Mar 2019 16:45:30 GMT
Author: fschumacher
Date: Wed Mar 20 16:45:30 2019
New Revision: 1855928

URL: http://svn.apache.org/viewvc?rev=1855928&view=rev
Log:
Change instantiation of concurrent set

Use ConcurrentHashMap#newKeySet instead of Collections#newSetFromMap. This will help
serialization frameworks, as it doesn't produces private class instances and it is
hopefully a bit more performant.

Followup to r1854648 and reported by Jan Verner.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java?rev=1855928&r1=1855927&r2=1855928&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java Wed Mar 20 16:45:30
2019
@@ -25,7 +25,6 @@ import java.net.URL;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
@@ -216,7 +215,7 @@ public class SampleResult implements Ser
      * In Non GUI mode and when best config is used, size never exceeds 1,
      * but as a compromise set it to 2
      */
-    private final Set<String> files = Collections.newSetFromMap(new ConcurrentHashMap<String,
Boolean>(2));
+    private final Set<String> files = ConcurrentHashMap.newKeySet(2);
 
     // TODO do contentType and/or dataEncoding belong in HTTPSampleResult instead?
     private String dataEncoding;// (is this really the character set?) e.g.



Mime
View raw message