Program: 168070
Project: 168070
Buggy source:
private void runLDA(File dir,File preSeedFile,int numTopics,int noOfSamples,double alphaval,double betaval,double confidenceValue,String outputdir,Date dateObj){
  DateFormat df=new SimpleDateFormat("String_Node_Str");
  File[] listOfFiles=dir.listFiles();
  List<File> inputFiles=new ArrayList<File>();
  monitor.subTask("String_Node_Str");
  for (  File f : listOfFiles) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    if (f.getAbsolutePath().contains("String_Node_Str"))     continue;
    inputFiles.add(f);
  }
  monitor.worked(5);
  ConsoleView.printlInConsoleln("String_Node_Str");
  DTWC dtwc=new DTWC(inputFiles,preSeedFile,this.monitor);
  dtwc.computeDocumentVectors();
  if (monitor.isCanceled()) {
    throw new OperationCanceledException();
  }
  int[][][] zlabels=dtwc.getTopicSeedsAsInt();
  int[][] docs=dtwc.getDocVectorsAsInt();
  int T=numTopics;
  int W=dtwc.getVocabSize();
  double[][] alpha=new double[1][T];
  for (int i=0; i < T; i++) {
    alpha[0][i]=alphaval;
  }
  double[][] beta=new double[T][W];
  for (int i=0; i < T; i++) {
    for (int j=0; j < W; j++) {
      beta[i][j]=betaval;
    }
  }
  ZlabelLDA zelda=new ZlabelLDA(docs,zlabels,confidenceValue,alpha,beta,noOfSamples);
  this.monitor.subTask("String_Node_Str");
  boolean retVal=zelda.zLDA();
  if (!retVal) {
    System.out.println("String_Node_Str");
    return;
  }
  this.monitor.worked(15);
  double[][] theta, phi;
  theta=zelda.getTheta();
  phi=zelda.getPhi();
  Map<String,Integer> dictionary=dtwc.getTermIndex();
  Map<Integer,String> revDict=dtwc.getIndexTerm();
  this.monitor.subTask("String_Node_Str");
  List<List<Map.Entry<String,Double>>> topicWords=new ArrayList<List<Map.Entry<String,Double>>>();
  for (int i=0; i < T; i++) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    topicWords.add(new ArrayList<Map.Entry<String,Double>>());
  }
  for (int i=0; i < T; i++) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    for (int j=0; j < W; j++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      if (phi[i][j] > Float.MIN_VALUE) {
        topicWords.get(i).add(new AbstractMap.SimpleEntry<String,Double>(revDict.get(j),new Double(phi[i][j])));
      }
    }
  }
  this.monitor.worked(15);
  this.monitor.subTask("String_Node_Str" + df.format(dateObj) + "String_Node_Str");
  System.out.println("String_Node_Str" + outputdir + File.separator+ "String_Node_Str"+ df.format(dateObj)+ "String_Node_Str");
  try {
    FileWriter fw=new FileWriter(new File(generateTopicWordsFileName(outputdir,df.format(dateObj))));
    StringBuilder row=new StringBuilder();
    StringBuilder rowValues=new StringBuilder();
    for (int i=0; i < T; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      row.append("String_Node_Str" + i + "String_Node_Str");
      rowValues.append("String_Node_Str");
    }
    fw.write(row.toString() + "String_Node_Str");
    fw.write(rowValues.toString() + "String_Node_Str");
    for (int i=0; i < T; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      Collections.sort(topicWords.get(i),new Comparator<Map.Entry<String,Double>>(){
        @Override public int compare(        Entry<String,Double> arg0,        Entry<String,Double> arg1){
          return -(arg0.getValue()).compareTo(arg1.getValue());
        }
      }
);
    }
    for (int k=0; k < 50; k++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      row=new StringBuilder();
      for (int i=0; i < T; i++) {
        if (monitor.isCanceled()) {
          throw new OperationCanceledException();
        }
        if (topicWords.get(i).get(k).getKey() != null) {
          row.append(topicWords.get(i).get(k).getKey() + "String_Node_Str" + topicWords.get(i).get(k).getValue()+ "String_Node_Str");
        }
 else {
          row.append("String_Node_Str");
        }
      }
      fw.write(row.toString() + "String_Node_Str");
      fw.flush();
    }
    fw.flush();
    fw.close();
    this.monitor.worked(15);
    this.monitor.subTask("String_Node_Str" + df.format(dateObj) + "String_Node_Str");
    ConsoleView.printlInConsoleln("String_Node_Str" + outputdir + File.separator+ "String_Node_Str"+ df.format(dateObj)+ "String_Node_Str");
    fw=new FileWriter(new File(generateWordsInTopicFileName(outputdir,df.format(dateObj))));
    fw.write("String_Node_Str");
    for (int j=0; j < revDict.size(); j++)     fw.write(revDict.get(j) + "String_Node_Str");
    fw.write("String_Node_Str");
    for (int i=0; i < T; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      fw.write("String_Node_Str" + i + "String_Node_Str");
      for (int j=0; j < phi[i].length; j++) {
        if (monitor.isCanceled()) {
          throw new OperationCanceledException();
        }
        if (phi[i][j] > Float.MIN_VALUE) {
          fw.write(phi[i][j] + "String_Node_Str");
        }
 else {
          fw.write("String_Node_Str");
        }
      }
      fw.write("String_Node_Str");
      fw.flush();
    }
    fw.flush();
    fw.close();
    this.monitor.worked(15);
    this.monitor.subTask("String_Node_Str" + df.format(dateObj) + "String_Node_Str");
    ConsoleView.printlInConsoleln("String_Node_Str" + outputdir + File.separator+ "String_Node_Str"+ df.format(dateObj)+ "String_Node_Str");
    fw=new FileWriter(new File(generateTopicsPerDocumentFileName(outputdir,df.format(dateObj))));
    fw.write("String_Node_Str");
    for (int i=0; i < T; i++) {
      fw.write("String_Node_Str" + i + "String_Node_Str");
    }
    fw.write("String_Node_Str");
    for (int i=0; i < docs.length; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      fw.write("String_Node_Str" + i + "String_Node_Str");
      for (int j=0; j < theta[i].length; j++) {
        fw.write(theta[i][j] + "String_Node_Str");
      }
      fw.write("String_Node_Str");
      fw.flush();
    }
    fw.flush();
    fw.close();
    createRunReport(outputdir,dateObj);
  }
 catch (  Exception e) {
    ConsoleView.printlInConsoleln("String_Node_Str" + e);
  }
  ConsoleView.printlInConsoleln("String_Node_Str");
  this.monitor.worked(15);
  this.monitor.done();
}

Fixed version (ground truth):
private void runLDA(File dir,File preSeedFile,int numTopics,int noOfSamples,double alphaval,double betaval,double confidenceValue,String outputdir,Date dateObj){
  monitor.beginTask("String_Node_Str",70);
  DateFormat df=new SimpleDateFormat("String_Node_Str");
  File[] listOfFiles=dir.listFiles();
  List<File> inputFiles=new ArrayList<File>();
  monitor.subTask("String_Node_Str");
  for (  File f : listOfFiles) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    if (f.getAbsolutePath().contains("String_Node_Str"))     continue;
    inputFiles.add(f);
  }
  monitor.worked(5);
  ConsoleView.printlInConsoleln("String_Node_Str");
  DTWC dtwc=new DTWC(inputFiles,preSeedFile,this.monitor);
  dtwc.computeDocumentVectors();
  if (monitor.isCanceled()) {
    throw new OperationCanceledException();
  }
  int[][][] zlabels=dtwc.getTopicSeedsAsInt();
  int[][] docs=dtwc.getDocVectorsAsInt();
  int T=numTopics;
  int W=dtwc.getVocabSize();
  double[][] alpha=new double[1][T];
  for (int i=0; i < T; i++) {
    alpha[0][i]=alphaval;
  }
  double[][] beta=new double[T][W];
  for (int i=0; i < T; i++) {
    for (int j=0; j < W; j++) {
      beta[i][j]=betaval;
    }
  }
  ZlabelLDA zelda=new ZlabelLDA(docs,zlabels,confidenceValue,alpha,beta,noOfSamples);
  this.monitor.subTask("String_Node_Str");
  boolean retVal=zelda.zLDA();
  if (!retVal) {
    System.out.println("String_Node_Str");
    return;
  }
  this.monitor.worked(15);
  double[][] theta, phi;
  theta=zelda.getTheta();
  phi=zelda.getPhi();
  Map<String,Integer> dictionary=dtwc.getTermIndex();
  Map<Integer,String> revDict=dtwc.getIndexTerm();
  this.monitor.subTask("String_Node_Str");
  List<List<Map.Entry<String,Double>>> topicWords=new ArrayList<List<Map.Entry<String,Double>>>();
  for (int i=0; i < T; i++) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    topicWords.add(new ArrayList<Map.Entry<String,Double>>());
  }
  for (int i=0; i < T; i++) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    for (int j=0; j < W; j++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      if (phi[i][j] > Float.MIN_VALUE) {
        topicWords.get(i).add(new AbstractMap.SimpleEntry<String,Double>(revDict.get(j),new Double(phi[i][j])));
      }
    }
  }
  this.monitor.worked(15);
  this.monitor.subTask("String_Node_Str" + df.format(dateObj) + "String_Node_Str");
  System.out.println("String_Node_Str" + outputdir + File.separator+ "String_Node_Str"+ df.format(dateObj)+ "String_Node_Str");
  try {
    FileWriter fw=new FileWriter(new File(generateTopicWordsFileName(outputdir,df.format(dateObj))));
    StringBuilder row=new StringBuilder();
    StringBuilder rowValues=new StringBuilder();
    for (int i=0; i < T; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      row.append("String_Node_Str" + i + "String_Node_Str");
      rowValues.append("String_Node_Str");
    }
    fw.write(row.toString() + "String_Node_Str");
    fw.write(rowValues.toString() + "String_Node_Str");
    for (int i=0; i < T; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      Collections.sort(topicWords.get(i),new Comparator<Map.Entry<String,Double>>(){
        @Override public int compare(        Entry<String,Double> arg0,        Entry<String,Double> arg1){
          return -(arg0.getValue()).compareTo(arg1.getValue());
        }
      }
);
    }
    for (int k=0; k < 50; k++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      row=new StringBuilder();
      for (int i=0; i < T; i++) {
        if (monitor.isCanceled()) {
          throw new OperationCanceledException();
        }
        if (topicWords.get(i).get(k).getKey() != null) {
          row.append(topicWords.get(i).get(k).getKey() + "String_Node_Str" + topicWords.get(i).get(k).getValue()+ "String_Node_Str");
        }
 else {
          row.append("String_Node_Str");
        }
      }
      fw.write(row.toString() + "String_Node_Str");
      fw.flush();
    }
    fw.flush();
    fw.close();
    this.monitor.worked(15);
    this.monitor.subTask("String_Node_Str" + df.format(dateObj) + "String_Node_Str");
    ConsoleView.printlInConsoleln("String_Node_Str" + outputdir + File.separator+ "String_Node_Str"+ df.format(dateObj)+ "String_Node_Str");
    fw=new FileWriter(new File(generateWordsInTopicFileName(outputdir,df.format(dateObj))));
    fw.write("String_Node_Str");
    for (int j=0; j < revDict.size(); j++)     fw.write(revDict.get(j) + "String_Node_Str");
    fw.write("String_Node_Str");
    for (int i=0; i < T; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      fw.write("String_Node_Str" + i + "String_Node_Str");
      for (int j=0; j < phi[i].length; j++) {
        if (monitor.isCanceled()) {
          throw new OperationCanceledException();
        }
        if (phi[i][j] > Float.MIN_VALUE) {
          fw.write(phi[i][j] + "String_Node_Str");
        }
 else {
          fw.write("String_Node_Str");
        }
      }
      fw.write("String_Node_Str");
      fw.flush();
    }
    fw.flush();
    fw.close();
    this.monitor.worked(15);
    this.monitor.subTask("String_Node_Str" + df.format(dateObj) + "String_Node_Str");
    ConsoleView.printlInConsoleln("String_Node_Str" + outputdir + File.separator+ "String_Node_Str"+ df.format(dateObj)+ "String_Node_Str");
    fw=new FileWriter(new File(generateTopicsPerDocumentFileName(outputdir,df.format(dateObj))));
    fw.write("String_Node_Str");
    for (int i=0; i < T; i++) {
      fw.write("String_Node_Str" + i + "String_Node_Str");
    }
    fw.write("String_Node_Str");
    for (int i=0; i < docs.length; i++) {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      fw.write("String_Node_Str" + i + "String_Node_Str");
      for (int j=0; j < theta[i].length; j++) {
        fw.write(theta[i][j] + "String_Node_Str");
      }
      fw.write("String_Node_Str");
      fw.flush();
    }
    fw.flush();
    fw.close();
    createRunReport(outputdir,dateObj);
  }
 catch (  Exception e) {
    ConsoleView.printlInConsoleln("String_Node_Str" + e);
  }
  ConsoleView.printlInConsoleln("String_Node_Str");
  this.monitor.worked(15);
  this.monitor.done();
}