From 8eb47c3c8f3a2ccec5c12b91aa21c4e09606abdf Mon Sep 17 00:00:00 2001 From: huomingkun <260587778@qq.com> Date: Sun, 17 Mar 2019 01:47:37 +0800 Subject: [PATCH] Add constant MIN_PATH_ARRAY_LENGTH Fixes #3625 --- .../dubbo/configcenter/support/zookeeper/CacheListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 4f6c6382952..250803cf0c8 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 @@ -89,7 +89,8 @@ public void dataChanged(String path, Object value, EventType eventType) { // TODO We limit the notification of config changes to a specific path level, for example // /dubbo/config/service/configurators, other config changes not in this level will not get notified, // say /dubbo/config/dubbo.properties - if (path.split("/").length >= 5) { + final int MIN_PATH_ARRAY_LENGTH = 5; + if (path.split("/").length >= MIN_PATH_ARRAY_LENGTH) { String key = pathToKey(path); ConfigChangeType changeType; switch (eventType) {