jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1843941 - /jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
Date Mon, 15 Oct 2018 19:28:06 GMT
Author: fschumacher
Date: Mon Oct 15 19:28:06 2018
New Revision: 1843941

URL: http://svn.apache.org/viewvc?rev=1843941&view=rev
Log:
Reduce duplicated code by using a variable

part of #409 on github

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java?rev=1843941&r1=1843940&r2=1843941&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java Mon Oct 15 19:28:06 2018
@@ -256,14 +256,9 @@ public class SaveService {
     private static void registerConverter(String key, String val) {
         try {
             final String trimmedValue = val.trim();
-            if (trimmedValue.equals("collection") // $NON-NLS-1$
-             || trimmedValue.equals("mapping")) { // $NON-NLS-1$
-                registerConverter(key, JMXSAVER, true);
-                registerConverter(key, JTLSAVER, true);
-            } else {
-                registerConverter(key, JMXSAVER, false);
-                registerConverter(key, JTLSAVER, false);
-            }
+            boolean useMapper = trimmedValue.equals("collection") || trimmedValue.equals("mapping");
// $NON-NLS-1$ $NON-NLS-2$
+            registerConverter(key, JMXSAVER, useMapper);
+            registerConverter(key, JTLSAVER, useMapper);
         } catch (IllegalAccessException | InstantiationException | ClassNotFoundException
| IllegalArgumentException|
                 SecurityException | InvocationTargetException | NoSuchMethodException e1)
{
             log.warn("Can't register a converter: {}", key, e1);



Mime
View raw message