Program: 9649
Project: 9649
Buggy source:
public List<EvaluatedDescriptionPosNeg> learn(Set<String> pos,Set<String> neg,OntModel model,int maxTime) throws IOException, ComponentInitException, LearningProblemUnsupportedException {
  ComponentManager cm=ComponentManager.getInstance();
  Monitor total=MonitorFactory.getTimeMonitor("String_Node_Str").start();
  Monitor totalPerEx=MonitorFactory.getTimeMonitor("String_Node_Str" + (pos.size() + neg.size())).start();
  try {
    Monitor owlapi=MonitorFactory.getTimeMonitor("String_Node_Str").start();
    model.createIndividual("String_Node_Str",model.createClass(OWL.Ontology.getURI()));
    ModelUtils.write(model,new File("String_Node_Str"));
    PipedOutputStream out=new PipedOutputStream();
    model.write(out,Constants.RDFXML);
    RDFWriter writer=model.getWriter("String_Node_Str");
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    writer.write(model,baos,"String_Node_Str");
    ByteArrayInputStream bs=new ByteArrayInputStream(baos.toString().getBytes());
    log.debug("String_Node_Str");
    OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
    OWLOntology retOnt=null;
    try {
      retOnt=manager.loadOntologyFromOntologyDocument(bs);
    }
 catch (    OWLOntologyCreationException e) {
      e.printStackTrace();
    }
    KnowledgeSource ks=new OWLAPIOntology(retOnt);
    ks.init();
    owlapi.stop();
    log.debug("String_Node_Str" + Helper.prettyPrintNanoSeconds((long)owlapi.getLastValue()));
    Monitor mon=MonitorFactory.getTimeMonitor("String_Node_Str").start();
    ReasonerComponent rc=cm.reasoner(reasoner,ks);
    rc.init();
    mon.stop();
    log.debug("String_Node_Str" + Helper.prettyPrintNanoSeconds((long)mon.getLastValue()));
    PosNegLPStandard lp=cm.learningProblem(PosNegLPStandard.class,rc);
    lp.setPositiveExamples(Helper.getIndividualSet(pos));
    lp.setNegativeExamples(Helper.getIndividualSet(neg));
    lp.init();
    ELLearningAlgorithm la=cm.learningAlgorithm(ELLearningAlgorithm.class,lp,rc);
    la.getConfigurator().setInstanceBasedDisjoints(false);
    la.init();
    log.debug("String_Node_Str");
    Monitor learn=MonitorFactory.getTimeMonitor("String_Node_Str").start();
    la.start();
    List<EvaluatedDescriptionPosNeg> eds=new ArrayList<EvaluatedDescriptionPosNeg>();
    int x=0;
    for (    EvaluatedDescription ed : la.getCurrentlyBestEvaluatedDescriptions()) {
      eds.add((EvaluatedDescriptionPosNeg)ed);
      if (x > 5) {
        break;
      }
      x++;
    }
    learn.stop();
    log.debug("String_Node_Str" + Helper.prettyPrintNanoSeconds((long)learn.getLastValue()));
    log.debug(eds.get(0).toString());
    return eds;
  }
  finally {
    cm.freeAllComponents();
    total.stop();
    totalPerEx.stop();
  }
}

Fixed version (ground truth):
public List<EvaluatedDescriptionPosNeg> learn(Set<String> pos,Set<String> neg,OntModel model,int maxTime) throws IOException, ComponentInitException, LearningProblemUnsupportedException {
  ComponentManager cm=ComponentManager.getInstance();
  Monitor total=MonitorFactory.getTimeMonitor("String_Node_Str").start();
  Monitor totalPerEx=MonitorFactory.getTimeMonitor("String_Node_Str" + (pos.size() + neg.size())).start();
  try {
    Monitor owlapi=MonitorFactory.getTimeMonitor("String_Node_Str").start();
    model.createIndividual("String_Node_Str",model.createClass(OWL.Ontology.getURI()));
    ModelUtils.write(model,new File("String_Node_Str"));
    PipedOutputStream out=new PipedOutputStream();
    model.write(out,Constants.RDFXML);
    RDFWriter writer=model.getWriter("String_Node_Str");
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    writer.write(model,baos,"String_Node_Str");
    ByteArrayInputStream bs=new ByteArrayInputStream(baos.toString().getBytes());
    log.debug("String_Node_Str");
    OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
    OWLOntology retOnt=null;
    try {
      retOnt=manager.loadOntologyFromOntologyDocument(bs);
    }
 catch (    OWLOntologyCreationException e) {
      e.printStackTrace();
    }
    KnowledgeSource ks=new OWLAPIOntology(retOnt);
    ks.init();
    owlapi.stop();
    log.debug("String_Node_Str" + Helper.prettyPrintNanoSeconds((long)owlapi.getLastValue()));
    Monitor mon=MonitorFactory.getTimeMonitor("String_Node_Str").start();
    ReasonerComponent rc=cm.reasoner(reasoner,ks);
    rc.init();
    mon.stop();
    log.debug("String_Node_Str" + Helper.prettyPrintNanoSeconds((long)mon.getLastValue()));
    PosNegLPStandard lp=cm.learningProblem(PosNegLPStandard.class,rc);
    lp.setPositiveExamples(Helper.getIndividualSet(pos));
    lp.setNegativeExamples(Helper.getIndividualSet(neg));
    lp.init();
    ELLearningAlgorithm la=cm.learningAlgorithm(ELLearningAlgorithm.class,lp,rc);
    la.getConfigurator().setInstanceBasedDisjoints(false);
    la.init();
    log.debug("String_Node_Str");
    Monitor learn=MonitorFactory.getTimeMonitor("String_Node_Str").start();
    la.start();
    List<EvaluatedDescriptionPosNeg> eds=new ArrayList<EvaluatedDescriptionPosNeg>();
    for (    EvaluatedDescription ed : ((TreeSet<EvaluatedDescriptionPosNeg>)la.getCurrentlyBestEvaluatedDescriptions()).descendingSet()) {
      eds.add((EvaluatedDescriptionPosNeg)ed);
      if (ed.getAccuracy() < 1.0) {
        break;
      }
    }
    learn.stop();
    log.debug("String_Node_Str" + Helper.prettyPrintNanoSeconds((long)learn.getLastValue()));
    log.debug(eds.get(0).toString());
    return eds;
  }
  finally {
    cm.freeAllComponents();
    total.stop();
    totalPerEx.stop();
  }
}