Program: 10228
Project: 10228
Buggy source:
/** 
 * @param args No arguments supported.
 * @throws IOException
 * @throws FileNotFoundException
 * @throws ParseException
 */
public static void main(String[] args) throws FileNotFoundException, IOException, ParseException {
  String[] files=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  File owlFile=new File("String_Node_Str");
  Program program=null;
  long startTime, duration;
  String time;
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  String content="String_Node_Str";
  for (  String file : files) {
    content+=Files.readFile(new File(prologDirectory + file));
  }
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  PrologParser pp=new PrologParser();
  program=pp.parseProgram(content);
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  KB kb=new KB();
  createChemElementsMapping();
  createNewGroups();
  NamedClass atomClass=getAtomicConcept("String_Node_Str");
  for (  String element : chemElements.values()) {
    NamedClass elClass=getAtomicConcept(element);
    SubClassAxiom sc=new SubClassAxiom(elClass,atomClass);
    kb.addAxiom(sc);
  }
  String kbString="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  if (!ignoreAmes) {
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  }
  if (includeMutagenesis) {
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  }
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+=getURI2("String_Node_Str") + "String_Node_Str" + getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+=getURI2("String_Node_Str") + "String_Node_Str" + getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+=getURI2("String_Node_Str") + "String_Node_Str" + getURI2("String_Node_Str")+ "String_Node_Str";
  KB kb2=KBParser.parseKBFile(kbString);
  kb.addKB(kb2);
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  ArrayList<Clause> clauses=program.getClauses();
  for (  Clause clause : clauses) {
    List<Axiom> axioms=mapClause(clause);
    for (    Axiom axiom : axioms)     kb.addAxiom(axiom);
  }
  if (includeMutagenesis)   addMutagenesis(kb);
  for (  String compound : compounds) {
    if (!ignoreAmes && !compoundsAmes.contains(compound)) {
      BooleanDatatypePropertyAssertion ames=getBooleanDatatypePropertyAssertion(compound,"String_Node_Str",false);
      kb.addAxiom(ames);
    }
  }
  String[] mainClasses=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Set<String> mainClassesSet=new HashSet<String>(Arrays.asList(mainClasses));
  DisjointClassesAxiom disjointAtomTypes=getDisjointClassesAxiom(mainClassesSet);
  kb.addAxiom(disjointAtomTypes);
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  OWLAPIReasoner.exportKBToOWL(owlFile,kb,ontologyURI);
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  File confTrainFile=new File("String_Node_Str");
  Files.clearFile(confTrainFile);
  String confHeader="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  Files.appendFile(confTrainFile,confHeader);
  File trainingFilePositives=new File(prologDirectory + "String_Node_Str");
  File trainingFileNegatives=new File(prologDirectory + "String_Node_Str");
  List<Individual> posTrainExamples=getExamples(trainingFilePositives);
  List<Individual> negTrainExamples=getExamples(trainingFileNegatives);
  appendPosExamples(confTrainFile,posTrainExamples);
  appendNegExamples(confTrainFile,negTrainExamples);
  File confPTE1File=new File("String_Node_Str");
  Files.clearFile(confPTE1File);
  File testPTE1Positives=new File(prologDirectory + "String_Node_Str");
  File testPTE1Negatives=new File(prologDirectory + "String_Node_Str");
  List<Individual> posPTE1Examples=getExamples(testPTE1Positives);
  List<Individual> negPTE1Examples=getExamples(testPTE1Negatives);
  appendPosExamples(confTrainFile,posPTE1Examples);
  appendNegExamples(confTrainFile,negPTE1Examples);
  Files.clearFile(confPTE1File);
  Files.appendFile(confPTE1File,"String_Node_Str");
  appendPosExamples(confPTE1File,posPTE1Examples);
  appendNegExamples(confPTE1File,negPTE1Examples);
  File confPTE2File=new File("String_Node_Str");
  Files.clearFile(confPTE2File);
  Files.appendFile(confPTE2File,"String_Node_Str");
  Files.appendFile(confPTE2File,getPTE2Examples());
}

Fixed version (ground truth):
/** 
 * @param args No arguments supported.
 * @throws IOException
 * @throws FileNotFoundException
 * @throws ParseException
 */
public static void main(String[] args) throws FileNotFoundException, IOException, ParseException {
  String[] files=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  File owlFile=new File("String_Node_Str");
  Program program=null;
  long startTime, duration;
  String time;
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  String content="String_Node_Str";
  for (  String file : files) {
    content+=Files.readFile(new File(prologDirectory + file));
  }
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  PrologParser pp=new PrologParser();
  program=pp.parseProgram(content);
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  KB kb=new KB();
  createChemElementsMapping();
  createNewGroups();
  NamedClass atomClass=getAtomicConcept("String_Node_Str");
  for (  String element : chemElements.values()) {
    NamedClass elClass=getAtomicConcept(element);
    SubClassAxiom sc=new SubClassAxiom(elClass,atomClass);
    kb.addAxiom(sc);
  }
  String kbString="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  if (!ignoreAmes) {
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  }
  if (includeMutagenesis) {
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
    kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  }
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str"+ getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+=getURI2("String_Node_Str") + "String_Node_Str" + getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+=getURI2("String_Node_Str") + "String_Node_Str" + getURI2("String_Node_Str")+ "String_Node_Str";
  kbString+=getURI2("String_Node_Str") + "String_Node_Str" + getURI2("String_Node_Str")+ "String_Node_Str";
  KB kb2=KBParser.parseKBFile(kbString);
  kb.addKB(kb2);
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  ArrayList<Clause> clauses=program.getClauses();
  for (  Clause clause : clauses) {
    List<Axiom> axioms=mapClause(clause);
    for (    Axiom axiom : axioms)     kb.addAxiom(axiom);
  }
  if (includeMutagenesis)   addMutagenesis(kb);
  for (  String compound : compounds) {
    if (!ignoreAmes && !compoundsAmes.contains(compound)) {
      BooleanDatatypePropertyAssertion ames=getBooleanDatatypePropertyAssertion(compound,"String_Node_Str",false);
      kb.addAxiom(ames);
    }
  }
  String[] mainClasses=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Set<String> mainClassesSet=new HashSet<String>(Arrays.asList(mainClasses));
  DisjointClassesAxiom disjointAtomTypes=getDisjointClassesAxiom(mainClassesSet);
  kb.addAxiom(disjointAtomTypes);
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  System.out.print("String_Node_Str");
  startTime=System.nanoTime();
  OWLAPIReasoner.exportKBToOWL(owlFile,kb,ontologyURI);
  duration=System.nanoTime() - startTime;
  time=Helper.prettyPrintNanoSeconds(duration,false,false);
  System.out.println("String_Node_Str" + time + "String_Node_Str");
  File confTrainFile=new File("String_Node_Str");
  Files.clearFile(confTrainFile);
  String confHeader="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str" + getURI2("String_Node_Str") + "String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  confHeader+="String_Node_Str";
  Files.appendFile(confTrainFile,confHeader);
  File trainingFilePositives=new File(prologDirectory + "String_Node_Str");
  File trainingFileNegatives=new File(prologDirectory + "String_Node_Str");
  List<Individual> posTrainExamples=getExamples(trainingFilePositives);
  List<Individual> negTrainExamples=getExamples(trainingFileNegatives);
  appendPosExamples(confTrainFile,posTrainExamples);
  appendNegExamples(confTrainFile,negTrainExamples);
  File confPTE1File=new File("String_Node_Str");
  File testPTE1Positives=new File(prologDirectory + "String_Node_Str");
  File testPTE1Negatives=new File(prologDirectory + "String_Node_Str");
  List<Individual> posPTE1Examples=getExamples(testPTE1Positives);
  List<Individual> negPTE1Examples=getExamples(testPTE1Negatives);
  appendPosExamples(confTrainFile,posPTE1Examples);
  appendNegExamples(confTrainFile,negPTE1Examples);
  if (createPTE1Conf) {
    Files.clearFile(confPTE1File);
    Files.appendFile(confPTE1File,"String_Node_Str");
    appendPosExamples(confPTE1File,posPTE1Examples);
    appendNegExamples(confPTE1File,negPTE1Examples);
  }
  if (createPTE2Conf) {
    File confPTE2File=new File("String_Node_Str");
    Files.clearFile(confPTE2File);
    Files.appendFile(confPTE2File,"String_Node_Str");
    Files.appendFile(confPTE2File,getPTE2Examples());
  }
}