You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/03/02 08:52:03 UTC

[GitHub] [incubator-inlong] luchunliang commented on a change in pull request #2811: [INLONG-2802][DataProxy] Fix mx.properties local file updating too often

luchunliang commented on a change in pull request #2811:
URL: https://github.com/apache/incubator-inlong/pull/2811#discussion_r817471354



##########
File path: inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/ConfigManager.java
##########
@@ -123,7 +123,8 @@ private boolean updatePropertiesHolder(Map<String, String> result,
             String oldValue = addElseRemove
                     ? tmpHolder.put(entry.getKey(), entry.getValue()) : tmpHolder.remove(entry.getKey());
             // if addElseRemove is false, that means removing item, changed is true.
-            if (oldValue == null || !oldValue.equals(entry.getValue()) || !addElseRemove) {
+            if ((oldValue == null && entry.getValue() != null) || !oldValue.equals(entry.getValue())
+                    || !addElseRemove) {

Review comment:
       oldValue.equals(entry.getValue()) maybe throw NullPointerException.
   (oldValue == null && entry.getValue() != null) maybe be false when oldValue == null and entry.getValue() == null.
   




-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org