Program: 89845
Project: 89845
Buggy source:
/** 
 * Method for correcting a bad entry from the archive. The current incorrect entry is put into the wrongEntryFile.  Then it calculates the checksum and corrects the entry for the file, and  then the checksum file is recreated from the archive in the memory.
 * @param filename The name of the file whose record should be removed.
 * @param rf The correct remote file to replace the bad one in the archive.
 * @param incorrectChecksum The checksum of the bad entry.
 * @throws ArgumentNotValid If one of the arguments are not valid.
 * @throws IOFailure If the entry cannot be corrected. Either the bad entrycannot be stored, or the new checksum file cannot be created.
 * @throws IllegalState If no such entry exists to be corrected, or if the entry has a different checksum than the incorrectChecksum.
 */
@Override public void correct(String filename,File correctFile) throws IOFailure, ArgumentNotValid, IllegalState {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  ArgumentNotValid.checkNotNull(correctFile,"String_Node_Str");
  if (!checksumArchive.containsKey(filename)) {
    String errMsg="String_Node_Str" + filename + "String_Node_Str";
    log.error(errMsg);
    throw new IllegalState(errMsg);
  }
  String currentChecksum=checksumArchive.get(filename);
  appendWrongRecordToWrongEntryFile(ChecksumJob.makeLine(filename,currentChecksum));
  String newChecksum=calculateChecksum(correctFile);
  if (newChecksum.equals(currentChecksum)) {
    log.warn("String_Node_Str");
    return;
  }
  checksumArchive.put(filename,newChecksum);
  recreateArchiveFile();
}

Fixed version (ground truth):
/** 
 * Method for correcting a bad entry from the archive. The current incorrect entry is put into the wrongEntryFile.  Then it calculates the checksum and corrects the entry for the file, and  then the checksum file is recreated from the archive in the memory.
 * @param filename The name of the file whose record should be removed.
 * @param correctFile The file that should replace the current entry
 * @throws ArgumentNotValid If one of the arguments are not valid.
 * @throws IOFailure If the entry cannot be corrected. Either the bad entrycannot be stored, or the new checksum file cannot be created.
 * @throws IllegalState If no such entry exists to be corrected, or if the entry has a different checksum than the incorrectChecksum.
 */
@Override public void correct(String filename,File correctFile) throws IOFailure, ArgumentNotValid, IllegalState {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  ArgumentNotValid.checkNotNull(correctFile,"String_Node_Str");
  if (!checksumArchive.containsKey(filename)) {
    String errMsg="String_Node_Str" + filename + "String_Node_Str";
    log.error(errMsg);
    throw new IllegalState(errMsg);
  }
  String currentChecksum=checksumArchive.get(filename);
  appendWrongRecordToWrongEntryFile(ChecksumJob.makeLine(filename,currentChecksum));
  String newChecksum=calculateChecksum(correctFile);
  if (newChecksum.equals(currentChecksum)) {
    log.warn("String_Node_Str");
    return;
  }
  checksumArchive.put(filename,newChecksum);
  recreateArchiveFile();
}