Program: 168167
Project: 168167
Buggy source:
public boolean calculateCooccurrences(List<String> selectedFiles,String seedFile,int windowSize,String outputPath,int threshold,boolean buildMatrix,IProgressMonitor monitor){
  String currentLine=null;
  Queue<String> q=new LinkedList<String>();
  List<String> phrase=new ArrayList<String>();
  setOutputPath(outputPath);
  try {
    boolean ret=false;
    if (windowSize > 0) {
      ret=setSeedWords(seedFile);
    }
    if (ret) {
      doPhrases=true;
    }
    File[] listOfFiles=(File[])selectedFiles.toArray(new File[selectedFiles.size()]);
    int seedWordCount=seedWords.size();
    int count;
    for (    File f : listOfFiles) {
      monitor.subTask("String_Node_Str" + f.getName());
      appendLog("String_Node_Str" + f.getName());
      count=0;
      if (f.getAbsolutePath().contains("String_Node_Str"))       continue;
      List<String> words=new ArrayList<String>();
      if (!f.exists() || f.isDirectory())       continue;
      BufferedReader br=new BufferedReader(new FileReader(f));
      int line_no=0;
      while ((currentLine=br.readLine()) != null) {
        if (currentLine.isEmpty() || currentLine.equals("String_Node_Str"))         continue;
        line_no++;
        for (        String word : currentLine.split("String_Node_Str")) {
          if (word.isEmpty() || word.equals("String_Node_Str"))           continue;
          word.replaceAll(delimiters,"String_Node_Str");
          if (buildMatrix)           words.add(word);
          if (doPhrases) {
            if (count >= threshold || count >= seedWordCount) {
              StringBuilder match=new StringBuilder();
              for (              String str : q) {
                if (seedWords.containsKey(str))                 match.append('*');
                match.append(str + ' ');
              }
              phrase.add(f.getName() + "String_Node_Str" + line_no+ "String_Node_Str"+ match.toString());
              q.clear();
              count=0;
              for (              String s : seedWords.keySet()) {
                seedWords.put(s,1);
              }
            }
 else             if (q.size() >= windowSize) {
              String first=q.remove();
              if (seedWords.containsKey(first)) {
                if (seedWords.get(first) == 0) {
                  count--;
                  seedWords.put(first,1);
                }
              }
            }
            q.add(word);
            if (seedWords.containsKey(word)) {
              if (seedWords.get(word) != 0) {
                count++;
                seedWords.put(word,0);
              }
            }
          }
          if (buildMatrix) {
            Map<String,Integer> vec=null;
            if (wordMat.containsKey(word)) {
              vec=wordMat.get(word);
            }
 else {
              vec=new HashMap<String,Integer>();
              wordMat.put(word,vec);
            }
            for (            String second : words) {
              if (vec.containsKey(second)) {
                vec.put(second,vec.get(second) + 1);
              }
 else {
                vec.put(second,1);
              }
              Map<String,Integer> temp=wordMat.get(second);
              if (temp.containsKey(word)) {
                temp.put(word,temp.get(word) + 1);
              }
 else {
                temp.put(word,1);
              }
            }
          }
        }
      }
      br.close();
      monitor.worked(1);
    }
    if (buildMatrix) {
      monitor.subTask("String_Node_Str");
      writeWordMatrix();
    }
    monitor.worked(10);
    if (ret && phrase.size() > 0) {
      monitor.subTask("String_Node_Str");
      writePhrases(phrase);
    }
    monitor.worked(10);
    ConsoleView.printlInConsoleln(String.valueOf(phrase.size()));
    Date dateObj=new Date();
    TacitUtility.createRunReport(outputPath,"String_Node_Str",dateObj);
    return true;
  }
 catch (  Exception e) {
    ConsoleView.printlInConsoleln("String_Node_Str" + e);
  }
  return false;
}

Fixed version (ground truth):
public boolean calculateCooccurrences(List<String> selectedFiles,String seedFile,int windowSize,String outputPath,int threshold,boolean buildMatrix,IProgressMonitor monitor){
  String currentLine=null;
  Queue<String> q=new LinkedList<String>();
  List<String> phrase=new ArrayList<String>();
  setOutputPath(outputPath);
  try {
    boolean ret=false;
    if (windowSize > 0) {
      ret=setSeedWords(seedFile);
    }
    if (ret) {
      doPhrases=true;
    }
    String[] listOfFiles=(String[])selectedFiles.toArray(new String[selectedFiles.size()]);
    int seedWordCount=seedWords.size();
    int count;
    for (    String fname : listOfFiles) {
      File f=new File(fname);
      monitor.subTask("String_Node_Str" + f.getName());
      appendLog("String_Node_Str" + f.getName());
      count=0;
      if (f.getAbsolutePath().contains("String_Node_Str"))       continue;
      List<String> words=new ArrayList<String>();
      if (!f.exists() || f.isDirectory())       continue;
      BufferedReader br=new BufferedReader(new FileReader(f));
      int line_no=0;
      while ((currentLine=br.readLine()) != null) {
        if (currentLine.isEmpty() || currentLine.equals("String_Node_Str"))         continue;
        line_no++;
        for (        String word : currentLine.split("String_Node_Str")) {
          if (word.isEmpty() || word.equals("String_Node_Str"))           continue;
          word.replaceAll(delimiters,"String_Node_Str");
          if (buildMatrix)           words.add(word);
          if (doPhrases) {
            if (count >= threshold || count >= seedWordCount) {
              StringBuilder match=new StringBuilder();
              for (              String str : q) {
                if (seedWords.containsKey(str))                 match.append('*');
                match.append(str + ' ');
              }
              phrase.add(f.getName() + "String_Node_Str" + line_no+ "String_Node_Str"+ match.toString());
              q.clear();
              count=0;
              for (              String s : seedWords.keySet()) {
                seedWords.put(s,1);
              }
            }
 else             if (q.size() >= windowSize) {
              String first=q.remove();
              if (seedWords.containsKey(first)) {
                if (seedWords.get(first) == 0) {
                  count--;
                  seedWords.put(first,1);
                }
              }
            }
            q.add(word);
            if (seedWords.containsKey(word)) {
              if (seedWords.get(word) != 0) {
                count++;
                seedWords.put(word,0);
              }
            }
          }
          if (buildMatrix) {
            Map<String,Integer> vec=null;
            if (wordMat.containsKey(word)) {
              vec=wordMat.get(word);
            }
 else {
              vec=new HashMap<String,Integer>();
              wordMat.put(word,vec);
            }
            for (            String second : words) {
              if (vec.containsKey(second)) {
                vec.put(second,vec.get(second) + 1);
              }
 else {
                vec.put(second,1);
              }
              Map<String,Integer> temp=wordMat.get(second);
              if (temp.containsKey(word)) {
                temp.put(word,temp.get(word) + 1);
              }
 else {
                temp.put(word,1);
              }
            }
          }
        }
      }
      br.close();
      monitor.worked(1);
    }
    if (buildMatrix) {
      monitor.subTask("String_Node_Str");
      writeWordMatrix();
    }
    monitor.worked(10);
    if (ret && phrase.size() > 0) {
      monitor.subTask("String_Node_Str");
      writePhrases(phrase);
    }
    monitor.worked(10);
    ConsoleView.printlInConsoleln(String.valueOf(phrase.size()));
    Date dateObj=new Date();
    TacitUtility.createRunReport(outputPath,"String_Node_Str",dateObj);
    return true;
  }
 catch (  Exception e) {
    ConsoleView.printlInConsoleln("String_Node_Str" + e);
  }
  return false;
}