Program: 9782
Project: 9782
Buggy source:
public static void main(String[] args) throws ComponentInitException, MalformedURLException {
  Map<String,Integer> ontologyRelClassCountMap=new HashMap<String,Integer>();
  File file=new File(args[0]);
  OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
  Reasoner reasoner=new Reasoner(manager);
  OWLOntology ontology;
  Set<OWLOntology> ontologies=new HashSet<OWLOntology>();
  StringBuffer sb=new StringBuffer();
  StringBuffer sb2=new StringBuffer();
  String url=null;
  try {
    BufferedReader in=new BufferedReader(new FileReader(file));
    sb2.append("String_Node_Str");
    while ((url=in.readLine()) != null) {
      try {
        System.out.println(url);
        ontology=manager.loadOntology(URI.create(url));
        ontologies.add(ontology);
        ontologies.addAll(manager.getImportsClosure(ontology));
        reasoner.loadOntologies(ontologies);
        sb.append(url + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getLogicalAxiomCount() + "String_Node_Str");
        sb2.append(ontology.getLogicalAxiomCount() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getClasses().size() + "String_Node_Str");
        sb2.append(ontology.getReferencedClasses().size() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getObjectProperties().size() + "String_Node_Str");
        sb2.append(ontology.getReferencedObjectProperties().size() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getDataProperties().size() + "String_Node_Str");
        sb2.append(ontology.getReferencedDataProperties().size() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getIndividuals().size() + "String_Node_Str");
        sb2.append(url + "String_Node_Str");
        reasoner.setOntology(ontology);
        if (reasoner.isConsistent()) {
          long startTime=System.currentTimeMillis();
          reasoner.classify();
          sb.append("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
          sb.append("String_Node_Str" + reasoner.getInconsistentClasses().size() + "String_Node_Str");
          int classCount=0;
          StringBuffer tmp=new StringBuffer();
          if (reasoner.getIndividuals().size() > 0) {
            for (            OWLClass cl : reasoner.getClasses()) {
              Set<OWLIndividual> inds=reasoner.getIndividuals(cl,false);
              if (inds.size() >= minInstanceCount) {
                classCount++;
                tmp.append("String_Node_Str" + cl.getURI() + "String_Node_Str");
                if (displayInstances) {
                  for (                  OWLIndividual ind : inds) {
                    tmp.append("String_Node_Str" + ind.toString() + "String_Node_Str");
                  }
                }
              }
            }
          }
          sb.append("String_Node_Str" + minInstanceCount + "String_Node_Str"+ classCount+ "String_Node_Str");
          if (displayClasses) {
            sb.append(tmp);
          }
          ontologyRelClassCountMap.put(url,classCount);
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append("String_Node_Str");
        sb2.append("String_Node_Str");
        reasoner.unloadOntologies(ontologies);
        manager.removeOntology(URI.create(url));
        ontologies.clear();
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  System.out.println(sb.toString());
  for (  Entry<String,Integer> ent : ontologyRelClassCountMap.entrySet()) {
    System.out.println(ent.getValue() + "String_Node_Str" + ent.getKey());
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws ComponentInitException, MalformedURLException {
  Map<String,Integer> ontologyRelClassCountMap=new HashMap<String,Integer>();
  File file=new File(args[0]);
  OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
  Reasoner reasoner=new Reasoner(manager);
  OWLOntology ontology;
  Set<OWLOntology> ontologies=new HashSet<OWLOntology>();
  StringBuffer sb=new StringBuffer();
  StringBuffer sb2=new StringBuffer();
  String url=null;
  try {
    BufferedReader in=new BufferedReader(new FileReader(file));
    sb2.append("String_Node_Str");
    while ((url=in.readLine()) != null) {
      try {
        System.out.println(url);
        ontology=manager.loadOntology(URI.create(url));
        ontologies.add(ontology);
        ontologies.addAll(manager.getImportsClosure(ontology));
        reasoner.loadOntologies(ontologies);
        sb.append(url + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getLogicalAxiomCount() + "String_Node_Str");
        sb2.append(ontology.getLogicalAxiomCount() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getClasses().size() + "String_Node_Str");
        sb2.append(ontology.getReferencedClasses().size() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getObjectProperties().size() + "String_Node_Str");
        sb2.append(ontology.getReferencedObjectProperties().size() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getDataProperties().size() + "String_Node_Str");
        sb2.append(ontology.getReferencedDataProperties().size() + "String_Node_Str");
        sb.append("String_Node_Str" + reasoner.getIndividuals().size() + "String_Node_Str");
        sb2.append(url + "String_Node_Str");
        reasoner.setOntology(ontology);
        if (reasoner.isConsistent()) {
          long startTime=System.currentTimeMillis();
          reasoner.classify();
          sb.append("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
          sb.append("String_Node_Str" + reasoner.getInconsistentClasses().size() + "String_Node_Str");
          int classCount=0;
          StringBuffer tmp=new StringBuffer();
          if (reasoner.getIndividuals().size() > 0) {
            for (            OWLClass cl : reasoner.getClasses()) {
              Set<OWLIndividual> inds=reasoner.getIndividuals(cl,false);
              if (inds.size() >= minInstanceCount) {
                classCount++;
                tmp.append("String_Node_Str" + cl.getURI() + "String_Node_Str");
                if (displayInstances) {
                  int indCount=0;
                  for (                  OWLIndividual ind : inds) {
                    tmp.append("String_Node_Str" + ind.toString() + "String_Node_Str");
                    indCount++;
                    if (indCount >= maxInstances) {
                      tmp.append("String_Node_Str" + inds.size() + "String_Node_Str");
                      break;
                    }
                  }
                }
              }
            }
          }
          sb.append("String_Node_Str" + minInstanceCount + "String_Node_Str"+ classCount+ "String_Node_Str");
          if (displayClasses) {
            sb.append(tmp);
          }
          ontologyRelClassCountMap.put(url,classCount);
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append("String_Node_Str");
        sb2.append("String_Node_Str");
        reasoner.unloadOntologies(ontologies);
        manager.removeOntology(URI.create(url));
        ontologies.clear();
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  System.out.println(sb.toString());
  for (  Entry<String,Integer> ent : ontologyRelClassCountMap.entrySet()) {
    System.out.println(ent.getValue() + "String_Node_Str" + ent.getKey());
  }
}