Program: 85922
Project: 85922
Buggy source:
private void reprocessUnincludedTxAfterReorg(Map<Sha256Hash,Transaction> pool,Transaction tx){
  log.info("String_Node_Str",tx.getHashAsString() + "String_Node_Str" + tx.getConfidence().getConfidenceType().name());
  boolean isDeadCoinbase=tx.isCoinBase() && ConfidenceType.DEAD == tx.getConfidence().getConfidenceType();
  if (isDeadCoinbase) {
    return;
  }
  int numInputs=tx.getInputs().size();
  int noSuchTx=0;
  int success=0;
  boolean isDead=false;
  Set<Transaction> connectedTransactions=new TreeSet<Transaction>();
  for (  TransactionInput input : tx.getInputs()) {
    TransactionInput.ConnectionResult result=input.connect(pool,TransactionInput.ConnectMode.ABORT_ON_CONFLICT);
    if (result == TransactionInput.ConnectionResult.SUCCESS) {
      success++;
      TransactionOutput connectedOutput=checkNotNull(input.getConnectedOutput(pool));
      connectedTransactions.add(checkNotNull(connectedOutput.parentTransaction));
    }
 else     if (result == TransactionInput.ConnectionResult.NO_SUCH_TX) {
      noSuchTx++;
    }
 else     if (result == TransactionInput.ConnectionResult.ALREADY_SPENT) {
      isDead=true;
      log.info("String_Node_Str",tx.getHashAsString());
      TransactionOutput doubleSpent=input.getConnectedOutput(pool);
      Transaction replacement=doubleSpent.getSpentBy().getParentTransaction();
      dead.put(tx.getHash(),tx);
      pending.remove(tx.getHash());
      tx.getConfidence().setOverridingTransaction(replacement);
      break;
    }
  }
  if (isDead)   return;
  if (noSuchTx == numInputs) {
    log.info("String_Node_Str",tx.getHashAsString() + "String_Node_Str" + tx.getConfidence().getConfidenceType().name());
    inactive.put(tx.getHash(),tx);
    dead.remove(tx.getHash());
  }
 else   if (success == numInputs - noSuchTx) {
    log.info("String_Node_Str",tx.getHashAsString() + "String_Node_Str" + tx.getConfidence().getConfidenceType().name());
    pending.put(tx.getHash(),tx);
    dead.remove(tx.getHash());
  }
  for (  Transaction maybeSpent : connectedTransactions) {
    maybeMoveTxToSpent(maybeSpent,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void reprocessUnincludedTxAfterReorg(Map<Sha256Hash,Transaction> pool,Transaction tx){
  log.info("String_Node_Str",tx.getHashAsString() + "String_Node_Str" + tx.getConfidence().getConfidenceType().name());
  boolean isDeadCoinbase=tx.isCoinBase() && ConfidenceType.DEAD == tx.getConfidence().getConfidenceType();
  if (isDeadCoinbase) {
    return;
  }
  int numInputs=tx.getInputs().size();
  int noSuchTx=0;
  int success=0;
  boolean isDead=false;
  Set<Transaction> connectedTransactions=new HashSet<Transaction>();
  for (  TransactionInput input : tx.getInputs()) {
    TransactionInput.ConnectionResult result=input.connect(pool,TransactionInput.ConnectMode.ABORT_ON_CONFLICT);
    if (result == TransactionInput.ConnectionResult.SUCCESS) {
      success++;
      TransactionOutput connectedOutput=checkNotNull(input.getConnectedOutput(pool));
      connectedTransactions.add(checkNotNull(connectedOutput.parentTransaction));
    }
 else     if (result == TransactionInput.ConnectionResult.NO_SUCH_TX) {
      noSuchTx++;
    }
 else     if (result == TransactionInput.ConnectionResult.ALREADY_SPENT) {
      isDead=true;
      log.info("String_Node_Str",tx.getHashAsString());
      TransactionOutput doubleSpent=input.getConnectedOutput(pool);
      Transaction replacement=doubleSpent.getSpentBy().getParentTransaction();
      dead.put(tx.getHash(),tx);
      pending.remove(tx.getHash());
      tx.getConfidence().setOverridingTransaction(replacement);
      break;
    }
  }
  if (isDead)   return;
  if (noSuchTx == numInputs) {
    log.info("String_Node_Str",tx.getHashAsString() + "String_Node_Str" + tx.getConfidence().getConfidenceType().name());
    inactive.put(tx.getHash(),tx);
    dead.remove(tx.getHash());
  }
 else   if (success == numInputs - noSuchTx) {
    log.info("String_Node_Str",tx.getHashAsString() + "String_Node_Str" + tx.getConfidence().getConfidenceType().name());
    pending.put(tx.getHash(),tx);
    dead.remove(tx.getHash());
  }
  for (  Transaction maybeSpent : connectedTransactions) {
    maybeMoveTxToSpent(maybeSpent,"String_Node_Str");
  }
}