Program: 6793
Project: 6793
Buggy source:
/** 
 * @syncpriority 200
 */
public void makeListenConnectionTo(final String sid,final SourceStatus ss){
  Node node=ss.getFromNode();
  final String nodeId=node.getId();
  if (mina.getCCM().isShuttingDown()) {
    log.debug("String_Node_Str" + nodeId + "String_Node_Str");
    return;
  }
  if (mina.getConfig().isAgoric() && !mina.getCurrencyClient().isReady()) {
    log.debug("String_Node_Str" + nodeId + "String_Node_Str");
    mina.getExecutor().schedule(new CatchingRunnable(){
      public void doRun() throws Exception {
        makeListenConnectionTo(sid,ss);
      }
    }
,5,TimeUnit.SECONDS);
    return;
  }
  ControlConnection cc=mina.getCCM().getCCWithId(nodeId);
  if (cc == null) {
synchronized (this) {
      if (!pendingCons.containsKey(sid))       pendingCons.put(sid,new HashSet<String>());
      if (pendingCons.get(sid).contains(nodeId)) {
        log.debug("String_Node_Str" + nodeId + "String_Node_Str"+ sid+ "String_Node_Str");
        return;
      }
      Attempt getCCAttempt=new GetCCAttempt(sid,ss);
      pendingCons.get(sid).add(nodeId);
      getCCAttempt.start();
      log.debug("String_Node_Str" + nodeId + "String_Node_Str"+ sid);
      mina.getCCM().makeCCTo(node,getCCAttempt);
    }
  }
 else   startListeningTo(cc,sid,ss);
}

Fixed version (ground truth):
/** 
 * @syncpriority 200
 */
public void makeListenConnectionTo(final String sid,final SourceStatus ss){
  Node node=ss.getFromNode();
  final String nodeId=node.getId();
  if (mina.getCCM().isShuttingDown()) {
    log.debug("String_Node_Str" + nodeId + "String_Node_Str");
    return;
  }
  if (mina.getConfig().isAgoric() && !mina.getCurrencyClient().isReady()) {
    log.debug("String_Node_Str" + nodeId + "String_Node_Str"+ sid+ "String_Node_Str");
    mina.getExecutor().schedule(new CatchingRunnable(){
      public void doRun() throws Exception {
        makeListenConnectionTo(sid,ss);
      }
    }
,5,TimeUnit.SECONDS);
    return;
  }
  ControlConnection cc=mina.getCCM().getCCWithId(nodeId);
  if (cc == null) {
synchronized (this) {
      if (!pendingCons.containsKey(sid))       pendingCons.put(sid,new HashSet<String>());
      if (pendingCons.get(sid).contains(nodeId)) {
        log.debug("String_Node_Str" + nodeId + "String_Node_Str"+ sid+ "String_Node_Str");
        return;
      }
      Attempt getCCAttempt=new GetCCAttempt(sid,ss);
      pendingCons.get(sid).add(nodeId);
      getCCAttempt.start();
      log.debug("String_Node_Str" + nodeId + "String_Node_Str"+ sid);
      mina.getCCM().makeCCTo(node,getCCAttempt);
    }
  }
 else {
    if (cc.isClosing()) {
      log.debug("String_Node_Str" + nodeId + "String_Node_Str"+ sid+ "String_Node_Str");
      mina.getExecutor().schedule(new CatchingRunnable(){
        public void doRun() throws Exception {
          makeListenConnectionTo(sid,ss);
        }
      }
,5,TimeUnit.SECONDS);
      return;
    }
    try {
      startListeningTo(cc,sid,ss);
    }
 catch (    IOException e) {
      log.error("String_Node_Str" + cc.getNodeId() + "String_Node_Str"+ sid,e);
      mina.getSourceMgr().cachePossiblyDeadSource(cc.getNode(),sid);
      mina.getStreamMgr().requestCachedSources(sid);
    }
  }
}