Skip to content

Commit

Permalink
Fixes #3625 (#3730)
Browse files Browse the repository at this point in the history
use constant to replace magic number
  • Loading branch information
John-Smile authored and kexianjun committed Mar 26, 2019
1 parent c1be6c6 commit ad72159
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/

public class CacheListener implements DataListener {
private static final int MIN_PATH_DEPTH = 5;

private Map<String, Set<ConfigurationListener>> keyListeners = new ConcurrentHashMap<>();
private CountDownLatch initializedLatch;
private String rootPath;
Expand Down Expand Up @@ -89,7 +91,7 @@ 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) {
if (path.split("/").length >= MIN_PATH_DEPTH) {
String key = pathToKey(path);
ConfigChangeType changeType;
switch (eventType) {
Expand Down

0 comments on commit ad72159

Please sign in to comment.