Allow properties with a default value to be overridden by an environment variable, to be consistent with the handling of properties without a default value

This commit is contained in:
Jasen Schremmer
2020-01-28 13:13:13 +11:00
parent 3a521c0ee0
commit 54120f374e

View File

@@ -178,14 +178,10 @@ public class HapiProperties {
} }
private static String getProperty(String propertyName, String defaultValue) { private static String getProperty(String propertyName, String defaultValue) {
Properties properties = HapiProperties.getProperties(); String value = getProperty(propertyName);
if (properties != null) { if (value != null && value.length() > 0) {
String value = properties.getProperty(propertyName); return value;
if (value != null && value.length() > 0) {
return value;
}
} }
return defaultValue; return defaultValue;