Fixed: EntityPerformanceTest.groovy shows error in log
propNames String Array can be empty of the 1st element can be null.
In the case of the calling by EntityPerformanceTest the 1st element is null.
@@ -38,6 +38,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.stream.Stream;
import org.apache.ofbiz.base.concurrent.ExecutionPool;
import org.apache.ofbiz.base.util.Debug;
@@ -150,6 +151,7 @@ public final class UtilCache<K, V> implements Serializable, EvictionListener<Obj
}
private static String getPropertyParam(ResourceBundle res, String[] propNames, String parameter) {
+ if (!Stream.of(propNames).anyMatch(string -> string == null || string.isEmpty())) {
try {
for (String propName : propNames) {
String key = propName.concat(".").concat(parameter);
@@ -163,6 +165,7 @@ public final class UtilCache<K, V> implements Serializable, EvictionListener<Obj
} catch (Exception e) {
Debug.logWarning(e, "Error getting " + parameter + " value from ResourceBundle for propNames: " + Arrays.toString(propNames), MODULE);
}
+ }
return null;
}
