Reduce code duplication in SystemProperties
This will replace a rarely seen log message saying "not found" with
one that says "default: ... => null", but that seems OK.
@@ -183,26 +183,7 @@ public class SystemProperties {
*/
@CheckForNull
public static String getString(String key) {
- String value = System.getProperty(key); // keep passing on any exceptions
- if (value != null) {
- if (LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value});
- }
- return value;
- }
-
- value = handler.getString(key);
- if (value != null) {
- if (LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value});
- }
- return value;
- }
-
- if (LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.log(Level.CONFIG, "Property (not found): {0}", key);
- }
- return null;
+ return getString(key, null);
}
/**
