You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/02/24 06:21:25 UTC
[incubator-dubbo] branch master updated: fix issue #3533 (#3548)
This is an automated email from the ASF dual-hosted git repository.
lixiaojie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new e89b3f2 fix issue #3533 (#3548)
e89b3f2 is described below
commit e89b3f2728248242e38e70627d761be776ef03ec
Author: THY <he...@163.com>
AuthorDate: Sun Feb 24 14:20:57 2019 +0800
fix issue #3533 (#3548)
---
.../apache/dubbo/configcenter/support/zookeeper/CacheListener.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/CacheListener.java b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/CacheListener.java
index a1e1f08..1851a22 100644
--- a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/CacheListener.java
+++ b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/CacheListener.java
@@ -38,6 +38,8 @@ import java.util.concurrent.CountDownLatch;
*
*/
public class CacheListener implements TreeCacheListener {
+ private static final byte[] EMPTY_BYTES = new byte[0];
+
private Map<String, Set<ConfigurationListener>> keyListeners = new ConcurrentHashMap<>();
private CountDownLatch initializedLatch;
private String rootPath;
@@ -83,6 +85,9 @@ public class CacheListener implements TreeCacheListener {
return;
}
+ if (value == null) {
+ value = EMPTY_BYTES;
+ }
ConfigChangeEvent configChangeEvent = new ConfigChangeEvent(key, new String(value, StandardCharsets.UTF_8), changeType);
Set<ConfigurationListener> listeners = keyListeners.get(key);
if (CollectionUtils.isNotEmpty(listeners)) {