RATIS-1991. Optimize the reconfig judgment logic in the ReconfigurationBase class. (#1004)
diff --git a/ratis-common/src/main/java/org/apache/ratis/conf/ReconfigurationBase.java b/ratis-common/src/main/java/org/apache/ratis/conf/ReconfigurationBase.java
index 6d4930e..8123e24 100644
--- a/ratis-common/src/main/java/org/apache/ratis/conf/ReconfigurationBase.java
+++ b/ratis-common/src/main/java/org/apache/ratis/conf/ReconfigurationBase.java
@@ -172,7 +172,7 @@
}
final String effective = reconfigureProperty(property, newValue);
LOG.info("{}: changed property {} to {} (effective {})", name, property, newValue, effective);
- if (newValue != null) {
+ if (effective != null) {
properties.set(property, effective);
} else {
properties.unset(property);