Program: 89830
Project: 89830
Buggy source:
/** 
 * Reads output from a checksum file.  Only the first instance of the desired file will be used.  If other filenames are encountered than the wanted one, they will be logged at level warning, as that is indicative of serious errors.  Having more than one instance of the desired file merely means it was found in several bitarchives, which is not our problem.
 * @param outputFile The file to read checksum from.
 * @param arcfileName The arcfile to find checksum for.
 * @return The checksum, or the empty stringif no checksum found for arcfilename.
 * @throws IOFailure If any error occurs reading the file.
 * @throws IllegalState if the read format is wrong
 */
private String readChecksum(File outputFile,String arcfileName) throws IOFailure, IllegalState {
  List<String> lines=FileUtils.readListFromFile(outputFile);
  List<String> checksumList=new ArrayList<String>();
  for (  String line : lines) {
    String readFileName="String_Node_Str";
    String checksum="String_Node_Str";
    String[] tokens=line.split(dk.netarkivet.archive.arcrepository.bitpreservation.Constants.STRING_FILENAME_SEPARATOR);
    boolean ignoreLine=false;
    ignoreLine=(tokens.length == 0 || line.isEmpty());
    if (tokens.length != 2 && !ignoreLine) {
      throw new IllegalState("String_Node_Str" + "String_Node_Str" + line + "String_Node_Str");
    }
    if (!ignoreLine) {
      readFileName=tokens[0];
      checksum=tokens[1];
      if (checksum.length() == 0) {
        ignoreLine=true;
        log.warn("String_Node_Str" + "String_Node_Str" + arcfileName + "String_Node_Str"+ line+ "String_Node_Str");
      }
 else {
        if (!readFileName.equals(arcfileName)) {
          ignoreLine=true;
          log.warn("String_Node_Str" + "String_Node_Str" + arcfileName + "String_Node_Str"+ "String_Node_Str"+ line+ "String_Node_Str");
        }
      }
    }
    if (checksumList.size() > 0 && !ignoreLine) {
      if (!checksum.equals(checksumList.get(checksumList.size() - 1))) {
        String errMsg="String_Node_Str" + arcfileName + "String_Node_Str"+ checksumList.get(0)+ "String_Node_Str"+ checksum+ "String_Node_Str"+ line+ "String_Node_Str";
        log.warn(errMsg);
        throw new IllegalState(errMsg);
      }
    }
    if (!ignoreLine) {
      checksumList.add(checksum);
    }
  }
  if (checksumList.size() > 1) {
    log.warn("String_Node_Str" + arcfileName + "String_Node_Str"+ checksumList.size()+ "String_Node_Str"+ checksumList.get(0));
  }
  if (checksumList.size() == 0) {
    log.debug("String_Node_Str" + arcfileName + "String_Node_Str"+ outputFile+ "String_Node_Str"+ FileUtils.readListFromFile(outputFile));
    return "String_Node_Str";
  }
 else {
    return checksumList.get(0);
  }
}

Fixed version (ground truth):
/** 
 * Reads output from a checksum file.  Only the first instance of the desired file will be used.  If other filenames are encountered than the wanted one, they will be logged at level warning, as that is indicative of serious errors.  Having more than one instance of the desired file merely means it was found in several bitarchives, which is not our problem.
 * @param outputFile The file to read checksum from.
 * @param arcfileName The arcfile to find checksum for.
 * @return The checksum, or the empty stringif no checksum found for arcfilename.
 * @throws IOFailure If any error occurs reading the file.
 * @throws IllegalState if the read format is wrong
 */
private String readChecksum(File outputFile,String arcfileName) throws IOFailure, IllegalState {
  List<String> lines=FileUtils.readListFromFile(outputFile);
  List<String> checksumList=new ArrayList<String>();
  for (  String line : lines) {
    String readFileName="String_Node_Str";
    String checksum="String_Node_Str";
    String[] tokens=line.split(dk.netarkivet.archive.arcrepository.bitpreservation.Constants.STRING_FILENAME_SEPARATOR);
    boolean ignoreLine=false;
    ignoreLine=(tokens.length == 0 || line.isEmpty());
    if (tokens.length != 2 && !ignoreLine) {
      throw new IllegalState("String_Node_Str" + "String_Node_Str" + line + "String_Node_Str");
    }
    if (!ignoreLine) {
      readFileName=tokens[0];
      checksum=tokens[1];
      if (checksum.length() == 0) {
        ignoreLine=true;
        log.warn("String_Node_Str" + "String_Node_Str" + arcfileName + "String_Node_Str"+ line+ "String_Node_Str");
      }
 else {
        if (!readFileName.equals(arcfileName)) {
          ignoreLine=true;
          log.warn("String_Node_Str" + "String_Node_Str" + arcfileName + "String_Node_Str"+ "String_Node_Str"+ line+ "String_Node_Str");
        }
      }
    }
    if (checksumList.size() > 0 && !ignoreLine && !checksum.equals(checksumList.get(checksumList.size() - 1))) {
      String errMsg="String_Node_Str" + arcfileName + "String_Node_Str"+ checksumList.get(0)+ "String_Node_Str"+ checksum+ "String_Node_Str"+ line+ "String_Node_Str";
      log.warn(errMsg);
      throw new IllegalState(errMsg);
    }
    if (!ignoreLine) {
      checksumList.add(checksum);
    }
  }
  if (checksumList.size() > 1) {
    log.warn("String_Node_Str" + arcfileName + "String_Node_Str"+ checksumList.size()+ "String_Node_Str"+ checksumList.get(0));
  }
  if (checksumList.size() == 0) {
    log.debug("String_Node_Str" + arcfileName + "String_Node_Str"+ outputFile+ "String_Node_Str"+ FileUtils.readListFromFile(outputFile));
    return "String_Node_Str";
  }
 else {
    return checksumList.get(0);
  }
}