Program: 85148
Project: 85148
Buggy source:
protected void doSubscribe(final URL url,final NotifyListener listener){
  try {
    if (Constants.ANY_VALUE.equals(url.getServiceInterface())) {
      String root=toRootPath();
      ConcurrentMap<NotifyListener,ChildListener> listeners=zkListeners.get(url);
      if (listeners == null) {
        zkListeners.putIfAbsent(url,new ConcurrentHashMap<NotifyListener,ChildListener>());
        listeners=zkListeners.get(url);
      }
      ChildListener zkListener=listeners.get(listener);
      if (zkListener == null) {
        listeners.putIfAbsent(listener,new ChildListener(){
          public void childChanged(          String parentPath,          List<String> currentChilds){
            for (            String child : currentChilds) {
              if (!anyServices.contains(child)) {
                anyServices.add(child);
                subscribe(url.setPath(child).addParameters(Constants.INTERFACE_KEY,child,Constants.CHECK_KEY,String.valueOf(false)),listener);
              }
            }
          }
        }
);
        zkListener=listeners.get(listener);
      }
      zkClient.create(root,false);
      List<String> services=zkClient.addChildListener(root,zkListener);
      if (services != null && services.size() > 0) {
        anyServices.addAll(services);
        for (        String service : services) {
          subscribe(url.setPath(service).addParameters(Constants.INTERFACE_KEY,service,Constants.CHECK_KEY,String.valueOf(false)),listener);
        }
      }
    }
 else {
      List<URL> urls=new ArrayList<URL>();
      for (      String path : toCategoriesPath(url)) {
        ConcurrentMap<NotifyListener,ChildListener> listeners=zkListeners.get(url);
        if (listeners == null) {
          zkListeners.putIfAbsent(url,new ConcurrentHashMap<NotifyListener,ChildListener>());
          listeners=zkListeners.get(url);
        }
        ChildListener zkListener=listeners.get(listener);
        if (zkListener == null) {
          listeners.putIfAbsent(listener,new ChildListener(){
            public void childChanged(            String parentPath,            List<String> currentChilds){
              ZookeeperRegistry.this.notify(url,listener,toUrlsWithEmpty(url,parentPath,currentChilds));
            }
          }
);
          zkListener=listeners.get(listener);
        }
        zkClient.create(path,false);
        List<String> children=zkClient.addChildListener(path,zkListener);
        if (children != null) {
          urls.addAll(toUrlsWithEmpty(url,path,children));
        }
      }
      notify(url,listener,urls);
    }
  }
 catch (  Throwable e) {
    throw new RpcException("String_Node_Str" + url + "String_Node_Str"+ getUrl()+ "String_Node_Str"+ e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected void doSubscribe(final URL url,final NotifyListener listener){
  try {
    if (Constants.ANY_VALUE.equals(url.getServiceInterface())) {
      String root=toRootPath();
      ConcurrentMap<NotifyListener,ChildListener> listeners=zkListeners.get(url);
      if (listeners == null) {
        zkListeners.putIfAbsent(url,new ConcurrentHashMap<NotifyListener,ChildListener>());
        listeners=zkListeners.get(url);
      }
      ChildListener zkListener=listeners.get(listener);
      if (zkListener == null) {
        listeners.putIfAbsent(listener,new ChildListener(){
          public void childChanged(          String parentPath,          List<String> currentChilds){
            for (            String child : currentChilds) {
              child=URL.decode(child);
              if (!anyServices.contains(child)) {
                anyServices.add(child);
                subscribe(url.setPath(child).addParameters(Constants.INTERFACE_KEY,child,Constants.CHECK_KEY,String.valueOf(false)),listener);
              }
            }
          }
        }
);
        zkListener=listeners.get(listener);
      }
      zkClient.create(root,false);
      List<String> services=zkClient.addChildListener(root,zkListener);
      if (services != null && services.size() > 0) {
        for (        String service : services) {
          service=URL.decode(service);
          anyServices.add(service);
          subscribe(url.setPath(service).addParameters(Constants.INTERFACE_KEY,service,Constants.CHECK_KEY,String.valueOf(false)),listener);
        }
      }
    }
 else {
      List<URL> urls=new ArrayList<URL>();
      for (      String path : toCategoriesPath(url)) {
        ConcurrentMap<NotifyListener,ChildListener> listeners=zkListeners.get(url);
        if (listeners == null) {
          zkListeners.putIfAbsent(url,new ConcurrentHashMap<NotifyListener,ChildListener>());
          listeners=zkListeners.get(url);
        }
        ChildListener zkListener=listeners.get(listener);
        if (zkListener == null) {
          listeners.putIfAbsent(listener,new ChildListener(){
            public void childChanged(            String parentPath,            List<String> currentChilds){
              ZookeeperRegistry.this.notify(url,listener,toUrlsWithEmpty(url,parentPath,currentChilds));
            }
          }
);
          zkListener=listeners.get(listener);
        }
        zkClient.create(path,false);
        List<String> children=zkClient.addChildListener(path,zkListener);
        if (children != null) {
          urls.addAll(toUrlsWithEmpty(url,path,children));
        }
      }
      notify(url,listener,urls);
    }
  }
 catch (  Throwable e) {
    throw new RpcException("String_Node_Str" + url + "String_Node_Str"+ getUrl()+ "String_Node_Str"+ e.getMessage(),e);
  }
}