Program: 39065
Project: 39065
Buggy source:
private void parseNewChangeCommand(final ReceiveCommand cmd){
  if (newChange != null) {
    reject(cmd,"String_Node_Str");
    return;
  }
  newChange=cmd;
  String destBranchName=cmd.getRefName().substring(NEW_CHANGE.length());
  if (!destBranchName.startsWith(Constants.R_REFS)) {
    destBranchName=Constants.R_HEADS + destBranchName;
  }
  try {
    destBranch=db.branches().get(new Branch.NameKey(proj.getNameKey(),destBranchName));
  }
 catch (  OrmException e) {
    log.error("String_Node_Str" + proj + "String_Node_Str"+ destBranchName,e);
    reject(cmd,"String_Node_Str");
    return;
  }
  if (destBranch == null) {
    String n=destBranchName;
    if (n.startsWith(Constants.R_HEADS))     n=n.substring(Constants.R_HEADS.length());
    reject(cmd,"String_Node_Str" + n + "String_Node_Str");
    return;
  }
  try {
    final RevWalk walk=rp.getRevWalk();
    final RevFlag CONNECTED=walk.newFlag("String_Node_Str");
    walk.carry(CONNECTED);
    walk.reset();
    walk.sort(RevSort.TOPO);
    walk.sort(RevSort.REVERSE,true);
    final RevCommit tip=walk.parseCommit(newChange.getNewId());
    tip.add(CONNECTED);
    walk.markStart(tip);
    final List<RevCommit> heads=new ArrayList<RevCommit>();
    for (    final Ref r : rp.getAdvertisedRefs().values()) {
      if (isHead(r) || isTag(r)) {
        try {
          final RevCommit h=walk.parseCommit(r.getObjectId());
          walk.markUninteresting(h);
          heads.add(h);
        }
 catch (        IOException e) {
          continue;
        }
      }
    }
    if (!heads.isEmpty()) {
      while (walk.next() != null) {
      }
      boolean isConnected=false;
      for (      final RevCommit c : heads) {
        if (c.has(CONNECTED)) {
          isConnected=true;
          break;
        }
      }
      if (!isConnected) {
        reject(newChange,"String_Node_Str");
        return;
      }
    }
  }
 catch (  IOException e) {
    newChange.setResult(Result.REJECTED_MISSING_OBJECT);
    log.error("String_Node_Str",e);
    return;
  }
}

Fixed version (ground truth):
private void parseNewChangeCommand(final ReceiveCommand cmd){
  if (newChange != null) {
    reject(cmd,"String_Node_Str");
    return;
  }
  newChange=cmd;
  String destBranchName=cmd.getRefName().substring(NEW_CHANGE.length());
  if (!destBranchName.startsWith(Constants.R_REFS)) {
    destBranchName=Constants.R_HEADS + destBranchName;
  }
  try {
    destBranch=db.branches().get(new Branch.NameKey(proj.getNameKey(),destBranchName));
  }
 catch (  OrmException e) {
    log.error("String_Node_Str" + proj + "String_Node_Str"+ destBranchName,e);
    reject(cmd,"String_Node_Str");
    return;
  }
  if (destBranch == null) {
    String n=destBranchName;
    if (n.startsWith(Constants.R_HEADS))     n=n.substring(Constants.R_HEADS.length());
    reject(cmd,"String_Node_Str" + n + "String_Node_Str");
    return;
  }
  try {
    final RevWalk walk=rp.getRevWalk();
    final RevFlag SIDE_NEW=walk.newFlag("String_Node_Str");
    final RevFlag SIDE_HAVE=walk.newFlag("String_Node_Str");
    final RevFlagSet COMMON=new RevFlagSet();
    COMMON.add(SIDE_NEW);
    COMMON.add(SIDE_HAVE);
    walk.carry(COMMON);
    walk.reset();
    walk.sort(RevSort.TOPO);
    walk.sort(RevSort.REVERSE,true);
    final RevCommit tip=walk.parseCommit(newChange.getNewId());
    tip.add(SIDE_NEW);
    walk.markStart(tip);
    boolean haveHeads=false;
    for (    final Ref r : rp.getAdvertisedRefs().values()) {
      if (isHead(r) || isTag(r)) {
        try {
          final RevCommit h=walk.parseCommit(r.getObjectId());
          h.add(SIDE_HAVE);
          walk.markStart(h);
          haveHeads=true;
        }
 catch (        IOException e) {
          continue;
        }
      }
    }
    if (haveHeads) {
      boolean isConnected=false;
      RevCommit c;
      while ((c=walk.next()) != null) {
        if (c.hasAll(COMMON)) {
          isConnected=true;
          break;
        }
      }
      if (!isConnected) {
        reject(newChange,"String_Node_Str");
        return;
      }
    }
  }
 catch (  IOException e) {
    newChange.setResult(Result.REJECTED_MISSING_OBJECT);
    log.error("String_Node_Str",e);
    return;
  }
}