提交 2741ffb3 编写于 作者: D Daniel Beck

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.
上级 3b85c0a8
......@@ -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);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册