Program: 9770
Project: 9770
Buggy source:
public static void main(String[] args) throws ComponentInitException, MalformedURLException {
  Map<String,Integer> ontologyRelClassCountMap=new HashMap<String,Integer>();
  Set<String> inconsistentOntologies=new HashSet<String>();
  Hashtable<String,Integer> incohaerentOntologies=new Hashtable<String,Integer>();
  File file=new File(args[0]);
  OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
  PelletReasoner reasoner;
  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");
    int count=1;
    while ((url=in.readLine()) != null) {
      try {
        System.out.println(count++ + "String_Node_Str" + url);
        ontology=manager.loadOntology(IRI.create(url));
        ontologies.add(ontology);
        ontologies.addAll(manager.getImportsClosure(ontology));
        reasoner=new PelletReasonerFactory().createReasoner(ontology);
        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" + ontology.getClassesInSignature(true).size() + "String_Node_Str");
        sb2.append(ontology.getClassesInSignature(true).size() + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getObjectPropertiesInSignature(true).size() + "String_Node_Str");
        sb2.append(ontology.getObjectPropertiesInSignature(true).size() + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getDataPropertiesInSignature(true).size() + "String_Node_Str");
        sb2.append(ontology.getDataPropertiesInSignature(true).size() + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getIndividualsInSignature(true).size() + "String_Node_Str");
        sb2.append(url + "String_Node_Str");
        if (reasoner.isConsistent()) {
          long startTime=System.currentTimeMillis();
          reasoner.prepareReasoner();
          sb.append("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
          int unsatCount=reasoner.getUnsatisfiableClasses().getEntitiesMinusBottom().size();
          sb.append("String_Node_Str" + unsatCount + "String_Node_Str");
          if (unsatCount > 0) {
            incohaerentOntologies.put(url,Integer.valueOf(unsatCount));
          }
          int classCount=0;
          StringBuffer tmp=new StringBuffer();
          if (ontology.getIndividualsInSignature(true).size() > 0) {
            for (            OWLClass cl : ontology.getClassesInSignature(true)) {
              Set<OWLNamedIndividual> inds=reasoner.getInstances(cl,false).getFlattened();
              if (inds.size() >= minInstanceCount) {
                classCount++;
                tmp.append("String_Node_Str" + cl.getIRI() + "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 {
          inconsistentOntologies.add(url);
          sb.append("String_Node_Str");
        }
        sb.append("String_Node_Str");
        sb2.append("String_Node_Str");
        reasoner.dispose();
        manager.removeOntology(ontology);
        ontologies.clear();
        System.out.println(inconsistentOntologies.size() + "String_Node_Str");
        int cnt=1;
        for (        String uri : inconsistentOntologies) {
          System.out.println(uri);
        }
        System.out.println();
        System.out.println(incohaerentOntologies.size() + "String_Node_Str");
        cnt=1;
        for (        Entry<String,Integer> ent : incohaerentOntologies.entrySet()) {
          System.out.println(cnt++ + "String_Node_Str" + ent.getKey()+ "String_Node_Str"+ ent.getValue()+ "String_Node_Str");
        }
        System.out.println();
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  System.out.println(sb.toString());
  System.out.println(sb2.toString());
  for (  Entry<String,Integer> ent : ontologyRelClassCountMap.entrySet()) {
    System.out.println(ent.getValue() + "String_Node_Str" + ent.getKey());
  }
  System.out.println("String_Node_Str");
  for (  String uri : inconsistentOntologies) {
    System.out.println(uri);
  }
  System.out.println("String_Node_Str");
  for (  Entry<String,Integer> ent : incohaerentOntologies.entrySet()) {
    System.out.println(ent.getKey() + "String_Node_Str" + ent.getValue()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws ComponentInitException, MalformedURLException {
  Map<String,Integer> ontologyRelClassCountMap=new HashMap<String,Integer>();
  Set<String> inconsistentOntologies=new HashSet<String>();
  Hashtable<String,Integer> incohaerentOntologies=new Hashtable<String,Integer>();
  File file=new File(args[0]);
  OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
  PelletReasoner reasoner;
  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");
    int count=1;
    while ((url=in.readLine()) != null) {
      try {
        System.out.println(count++ + "String_Node_Str" + url);
        ontology=manager.loadOntology(IRI.create(url));
        ontologies.add(ontology);
        ontologies.addAll(manager.getImportsClosure(ontology));
        reasoner=new PelletReasonerFactory().createReasoner(ontology);
        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" + ontology.getClassesInSignature(true).size() + "String_Node_Str");
        sb2.append(ontology.getClassesInSignature(true).size() + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getObjectPropertiesInSignature(true).size() + "String_Node_Str");
        sb2.append(ontology.getObjectPropertiesInSignature(true).size() + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getDataPropertiesInSignature(true).size() + "String_Node_Str");
        sb2.append(ontology.getDataPropertiesInSignature(true).size() + "String_Node_Str");
        sb.append("String_Node_Str" + ontology.getIndividualsInSignature(true).size() + "String_Node_Str");
        sb2.append(url + "String_Node_Str");
        if (reasoner.isConsistent()) {
          long startTime=System.currentTimeMillis();
          reasoner.prepareReasoner();
          sb.append("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
          int unsatCount=reasoner.getUnsatisfiableClasses().getEntitiesMinusBottom().size();
          sb.append("String_Node_Str" + unsatCount + "String_Node_Str");
          if (unsatCount > 0) {
            incohaerentOntologies.put(url,Integer.valueOf(unsatCount));
          }
          int classCount=0;
          StringBuffer tmp=new StringBuffer();
          if (ontology.getIndividualsInSignature(true).size() > 0) {
            for (            OWLClass cl : ontology.getClassesInSignature(true)) {
              Set<OWLNamedIndividual> inds=reasoner.getInstances(cl,false).getFlattened();
              if (inds.size() >= minInstanceCount) {
                classCount++;
                tmp.append("String_Node_Str" + cl.getIRI() + "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 {
          inconsistentOntologies.add(url);
          sb.append("String_Node_Str");
        }
        sb.append("String_Node_Str");
        sb2.append("String_Node_Str");
        reasoner.dispose();
        manager.removeOntology(ontology);
        ontologies.clear();
        System.out.println(inconsistentOntologies.size() + "String_Node_Str");
        int cnt=1;
        for (        String uri : inconsistentOntologies) {
          System.out.println(cnt++ + "String_Node_Str" + uri);
        }
        System.out.println();
        System.out.println(incohaerentOntologies.size() + "String_Node_Str");
        cnt=1;
        for (        Entry<String,Integer> ent : incohaerentOntologies.entrySet()) {
          System.out.println(cnt++ + "String_Node_Str" + ent.getKey()+ "String_Node_Str"+ ent.getValue()+ "String_Node_Str");
        }
        System.out.println();
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  System.out.println(sb.toString());
  System.out.println(sb2.toString());
  for (  Entry<String,Integer> ent : ontologyRelClassCountMap.entrySet()) {
    System.out.println(ent.getValue() + "String_Node_Str" + ent.getKey());
  }
  System.out.println("String_Node_Str");
  for (  String uri : inconsistentOntologies) {
    System.out.println(uri);
  }
  System.out.println("String_Node_Str");
  for (  Entry<String,Integer> ent : incohaerentOntologies.entrySet()) {
    System.out.println(ent.getKey() + "String_Node_Str" + ent.getValue()+ "String_Node_Str");
  }
}