Program: 132409
Project: 132409
Buggy source:
/** 
 * <p>Removes requests from the queues of the   {@link ReplicationThread}.</p> <p>Resets the nextExpected, if necessary.</p>
 * @param < T >
 * @param rq
 * @throws ReplicationException 
 */
@SuppressWarnings("String_Node_Str") <T>void remove(Status<T> rq) throws ReplicationException {
  Logging.logMessage(Logging.LEVEL_TRACE,this,"String_Node_Str" + rq.toString());
  if (rq.getValue() instanceof Request) {
    pending.remove((Status<Request>)rq);
    Chunk chunk=((Request)rq.getValue()).getChunkDetails();
    if (hasHighPriority((Status<Request>)rq))     resetNextExpected();
    if (missing != null && missing.remove(new Status<LSN>(((Request)rq.getValue()).getLSN())))     resetNextExpected();
    if (missingChunks != null && chunk != null) {
      if (missingChunks.remove(new Status<Chunk>(chunk)))       resetNextExpected();
      if (missingChunks.isEmpty()) {
        try {
          LSN lsn=frontEnd.getLastWrittenLSN();
          frontEnd.dbInterface.reset(lsn);
          frontEnd.switchCondition(CONDITION.RUNNING);
          Logging.logMessage(Logging.LEVEL_INFO,this,"String_Node_Str" + lsn.toString());
        }
 catch (        BabuDBException e) {
          throw new ReplicationException("String_Node_Str" + e.getMessage());
        }
      }
 else {
        setNextExpected(new Status<Request>(RequestPreProcessor.getExpectedCHUNK_RP(chunk),true));
      }
    }
    ((Request)rq.getValue()).free();
  }
 else   if (rq.getValue() instanceof LSN) {
    missing.remove((Status<LSN>)rq);
  }
 else   if (rq.getValue() instanceof Chunk) {
    missingChunks.remove((Status<Chunk>)rq);
  }
 else   throw new ReplicationException("String_Node_Str" + rq.toString());
}

Fixed version (ground truth):
/** 
 * <p>Removes requests from the queues of the   {@link ReplicationThread}.</p> <p>Resets the nextExpected, if necessary.</p>
 * @param < T >
 * @param rq
 * @throws ReplicationException 
 */
@SuppressWarnings("String_Node_Str") <T>void remove(Status<T> rq) throws ReplicationException {
  Logging.logMessage(Logging.LEVEL_TRACE,this,"String_Node_Str" + rq.toString());
  if (rq.getValue() instanceof Request) {
    pending.remove((Status<Request>)rq);
    Chunk chunk=((Request)rq.getValue()).getChunkDetails();
    LSN lsn=((Request)rq.getValue()).getLSN();
    if (hasHighPriority((Status<Request>)rq))     resetNextExpected();
    if (lsn != null && missing != null && missing.remove(new Status<LSN>(lsn)))     resetNextExpected();
    if (chunk != null && missingChunks != null) {
      if (missingChunks.remove(new Status<Chunk>(chunk)))       resetNextExpected();
      if (missingChunks.isEmpty()) {
        try {
          lsn=frontEnd.getLastWrittenLSN();
          frontEnd.dbInterface.reset(lsn);
          frontEnd.switchCondition(CONDITION.RUNNING);
          Logging.logMessage(Logging.LEVEL_INFO,this,"String_Node_Str" + lsn.toString());
        }
 catch (        BabuDBException e) {
          throw new ReplicationException("String_Node_Str" + e.getMessage());
        }
      }
 else {
        setNextExpected(new Status<Request>(RequestPreProcessor.getExpectedCHUNK_RP(chunk),true));
      }
    }
    ((Request)rq.getValue()).free();
  }
 else   if (rq.getValue() instanceof LSN) {
    missing.remove((Status<LSN>)rq);
  }
 else   if (rq.getValue() instanceof Chunk) {
    missingChunks.remove((Status<Chunk>)rq);
  }
 else   throw new ReplicationException("String_Node_Str" + rq.toString());
}