Program: 135071
Project: 135071
Buggy source:
/** 
 * Load the logs from the given file in the Cache appending their starting position in the index vector. The logs are appended at the end of the cache as well as the new positions are appended at the end of the index vector. The load is performed in a thread as it might be very slow
 * @param br The the file to read
 * @param logListener The callback for each new log read from the IO
 * @param cache The cache of logs
 */
private void loadLogsFromDisk(BufferedReader br,IACSLogRemoteConnection logListener,LogCache cache){
  if (br == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String tag=null;
  LogStringBuffer buffer=new LogStringBuffer();
  int chRead;
  int bytesRead=0;
  int logRecordsRead=0;
  boolean lookForOpenTag=true;
  try {
    StopWatch stopWatch=new StopWatch();
    while ((chRead=br.read()) != -1) {
      bytesRead++;
      buffer.append((char)chRead);
      if (chRead == '>') {
        if (lookForOpenTag) {
          tag=buffer.getOpeningTag();
          if (tag.length() > 0) {
            lookForOpenTag=false;
            buffer.trim(tag);
          }
        }
 else {
          if (buffer.hasClosingTag(tag)) {
            lookForOpenTag=true;
            injectLog(buffer.toString(),logListener);
            buffer.clear();
            logRecordsRead++;
            if (progressDialog != null) {
              if (cache != null) {
                progressDialog.updateStatus("String_Node_Str" + cache.getSize() + "String_Node_Str");
              }
              progressDialog.updateProgressBar(bytesRead);
              if (progressDialog.wantsToAbort()) {
                break;
              }
            }
          }
        }
      }
    }
    System.out.println("String_Node_Str" + logRecordsRead + "String_Node_Str"+ stopWatch.getLapTimeMillis() / 1000 + "String_Node_Str");
    System.out.println(ResourceChecker.getMemoryStatusMessage());
  }
 catch (  IOException ioe) {
    System.err.println("String_Node_Str" + ioe.getMessage());
    ioe.printStackTrace(System.err);
    JOptionPane.showMessageDialog(null,"String_Node_Str" + ioe.getMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return;
  }
  if (progressDialog != null) {
    progressDialog.setVisible(false);
    progressDialog.dispose();
    progressDialog=null;
  }
  IOOperationTerminated();
}

Fixed version (ground truth):
/** 
 * Load the logs from the given file in the Cache appending their starting position in the index vector. The logs are appended at the end of the cache as well as the new positions are appended at the end of the index vector. The load is performed in a thread as it might be very slow
 * @param br The the file to read
 * @param logListener The callback for each new log read from the IO
 * @param cache The cache of logs
 */
private void loadLogsFromDisk(BufferedReader br,IACSLogRemoteConnection logListener,LogCache cache){
  if (br == null || logListener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String tag=null;
  LogStringBuffer buffer=new LogStringBuffer();
  int chRead;
  int bytesRead=0;
  int logRecordsRead=0;
  try {
    StopWatch stopWatch=new StopWatch();
    while ((chRead=br.read()) != -1) {
      bytesRead++;
      buffer.append((char)chRead);
      if (chRead == '>') {
        tag=buffer.getOpeningTag();
        if (tag.length() > 0) {
          buffer.trim(tag);
        }
        if (buffer.hasClosingTag(tag)) {
          injectLog(buffer.toString(),logListener);
          buffer.clear();
          logRecordsRead++;
          if (progressDialog != null) {
            if (cache != null) {
              progressDialog.updateStatus("String_Node_Str" + cache.getSize() + "String_Node_Str");
            }
            progressDialog.updateProgressBar(bytesRead);
            if (progressDialog.wantsToAbort()) {
              break;
            }
          }
        }
      }
    }
    System.out.println("String_Node_Str" + logRecordsRead + "String_Node_Str"+ stopWatch.getLapTimeMillis() / 1000 + "String_Node_Str");
    System.out.println(ResourceChecker.getMemoryStatusMessage());
  }
 catch (  IOException ioe) {
    System.err.println("String_Node_Str" + ioe.getMessage());
    ioe.printStackTrace(System.err);
    JOptionPane.showMessageDialog(null,"String_Node_Str" + ioe.getMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return;
  }
  if (progressDialog != null) {
    progressDialog.setVisible(false);
    progressDialog.dispose();
    progressDialog=null;
  }
  IOOperationTerminated();
}