vlsi commented on a change in pull request #677:
URL: https://github.com/apache/jmeter/pull/677#discussion_r753699684



##########
File path: src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java
##########
@@ -713,6 +714,27 @@ public static boolean getPropDefault(String propName, 
boolean defaultVal) {
         return defaultVal;
     }
 
+    /**
+     * Get an array of String if present and not empty, defaultValue if not 
present.
+     *
+     * @param propName
+     *            the name of the property.
+     * @param defaultVal
+     *            the default value.
+     * @return The PropDefault value
+     */
+    public static String[] getArrayPropDefault(String propName, String[] 
defaultVal) {
+        try {
+            String strVal = appProperties.getProperty(propName);
+            if (StringUtils.isNotBlank(strVal)) {
+                return strVal.trim().split("\\s+");
+            }
+        } catch (Exception e) {
+            log.warn("Exception '{}' occurred when fetching boolean 
property:'{}', defaulting to: {}", e.getMessage(), propName, defaultVal);

Review comment:
       String[].toString() is useless. Please use Arrays.toString(...)
   
   Does it make sense to pass the exception for printing the stacktrace as well?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to