AlbumenJ commented on code in PR #10839:
URL: https://github.com/apache/dubbo/pull/10839#discussion_r1006351222
##########
dubbo-common/src/main/java/org/apache/dubbo/common/config/SystemConfiguration.java:
##########
@@ -18,15 +18,27 @@
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
/**
- * Configuration from system properties
+ * FIXME: is this really necessary? PropertiesConfiguration should have
already covered this:
+ *
+ * @See ConfigUtils#getProperty(String)
+ * @see PropertiesConfiguration
*/
public class SystemConfiguration implements Configuration {
+ private final Map<String, Object> cache = new ConcurrentHashMap<>();
+
@Override
public Object getInternalProperty(String key) {
- return System.getProperty(key);
+ if (cache.containsKey(key)) {
+ return cache.get(key);
+ } else {
+ Object val = System.getProperty(key);
+ cache.putIfAbsent(key, val);
Review Comment:
val may null here
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]