Program: 82478
Project: 82478
Buggy source:
public WatchChildren watch(final OnChange onChange){
  if (_debug) {
    StringWriter writer=new StringWriter();
    PrintWriter printWriter=new PrintWriter(writer);
    new Throwable().printStackTrace(printWriter);
    printWriter.close();
    _debugStackTrace=writer.toString();
  }
  _watchThread=new Thread(new Runnable(){
    @Override public void run(){
      startDoubleCheckThread();
      while (_running.get()) {
synchronized (_lock) {
          try {
            _children=_zooKeeper.getChildren(_path,new Watcher(){
              @Override public void process(              WatchedEvent event){
synchronized (_lock) {
                  _lock.notify();
                }
              }
            }
);
            try {
              onChange.action(_children);
            }
 catch (            Throwable t) {
              LOG.error("String_Node_Str" + this + "String_Node_Str",t);
            }
            _lock.wait();
          }
 catch (          KeeperException e) {
            LOG.error("String_Node_Str",e,instance);
            if (!_running.get()) {
              LOG.info("String_Node_Str",e.getMessage());
              return;
            }
            if (e.code() == Code.NONODE) {
              if (_debug) {
                LOG.debug("String_Node_Str",_path,_debugStackTrace);
              }
 else {
                LOG.debug("String_Node_Str",_path);
              }
              close();
              return;
            }
            if (_debug) {
              LOG.error("String_Node_Str",e,_debugStackTrace);
            }
 else {
              LOG.error("String_Node_Str",e);
            }
            throw new RuntimeException(e);
          }
catch (          InterruptedException e) {
            return;
          }
        }
      }
      _running.set(false);
    }
  }
);
  _watchThread.setName("String_Node_Str" + _path + "String_Node_Str"+ instance+ "String_Node_Str");
  _watchThread.setDaemon(true);
  _watchThread.start();
  return this;
}

Fixed version (ground truth):
public WatchChildren watch(final OnChange onChange){
  if (_debug) {
    StringWriter writer=new StringWriter();
    PrintWriter printWriter=new PrintWriter(writer);
    new Throwable().printStackTrace(printWriter);
    printWriter.close();
    _debugStackTrace=writer.toString();
  }
  _watchThread=new Thread(new Runnable(){
    @Override public void run(){
      Watcher watcher=new Watcher(){
        @Override public void process(        WatchedEvent event){
synchronized (_lock) {
            _lock.notify();
          }
        }
      }
;
      startDoubleCheckThread();
      while (_running.get()) {
synchronized (_lock) {
          try {
            _children=_zooKeeper.getChildren(_path,watcher);
            try {
              onChange.action(_children);
            }
 catch (            Throwable t) {
              LOG.error("String_Node_Str" + this + "String_Node_Str",t);
            }
            _lock.wait();
          }
 catch (          KeeperException e) {
            LOG.error("String_Node_Str",e,instance);
            if (!_running.get()) {
              LOG.info("String_Node_Str",e.getMessage());
              return;
            }
            if (e.code() == Code.NONODE) {
              if (_debug) {
                LOG.debug("String_Node_Str",_path,_debugStackTrace);
              }
 else {
                LOG.debug("String_Node_Str",_path);
              }
              close();
              return;
            }
            if (_debug) {
              LOG.error("String_Node_Str",e,_debugStackTrace);
            }
 else {
              LOG.error("String_Node_Str",e);
            }
            throw new RuntimeException(e);
          }
catch (          InterruptedException e) {
            return;
          }
        }
      }
      _running.set(false);
    }
  }
);
  _watchThread.setName("String_Node_Str" + _path + "String_Node_Str"+ instance+ "String_Node_Str");
  _watchThread.setDaemon(true);
  _watchThread.start();
  return this;
}