Program: 9749
Project: 9749
Buggy source:
public void loadOntologies() throws URISyntaxException, OWLOntologyCreationException {
  Comparator<OWLNamedObject> namedObjectComparator=new Comparator<OWLNamedObject>(){
    public int compare(    OWLNamedObject o1,    OWLNamedObject o2){
      return o1.getIRI().compareTo(o2.getIRI());
    }
  }
;
  Set<OWLClass> classes=new TreeSet<OWLClass>(namedObjectComparator);
  Set<OWLObjectProperty> owlObjectProperties=new TreeSet<OWLObjectProperty>(namedObjectComparator);
  Set<OWLDataProperty> owlDatatypeProperties=new TreeSet<OWLDataProperty>(namedObjectComparator);
  Set<OWLNamedIndividual> owlIndividuals=new TreeSet<OWLNamedIndividual>(namedObjectComparator);
  loadedOntologies=new HashSet<OWLOntology>();
  Set<OWLOntology> allImports=new HashSet<OWLOntology>();
  prefixes=new TreeMap<String,String>();
  for (  KnowledgeSource source : sources) {
    if (source instanceof OWLFile || source instanceof SparqlKnowledgeSource || source instanceof OWLAPIOntology) {
      URL url=null;
      if (source instanceof OWLFile) {
        url=((OWLFile)source).getURL();
      }
      if (source instanceof OWLAPIOntology) {
        ontology=((OWLAPIOntology)source).getOWLOntolgy();
      }
 else       if (source instanceof SparqlKnowledgeSource) {
        ontology=((SparqlKnowledgeSource)source).getOWLAPIOntology();
      }
 else {
        ontology=manager.loadOntologyFromOntologyDocument(IRI.create(url));
      }
      owlAPIOntologies.add(ontology);
      Set<OWLOntology> imports=manager.getImportsClosure(ontology);
      allImports.addAll(imports);
      loadedOntologies.addAll(imports);
      classes.addAll(ontology.getClassesInSignature(true));
      owlObjectProperties.addAll(ontology.getObjectPropertiesInSignature(true));
      owlDatatypeProperties.addAll(ontology.getDataPropertiesInSignature(true));
      owlIndividuals.addAll(ontology.getIndividualsInSignature(true));
      OWLOntologyFormat format=manager.getOntologyFormat(ontology);
      if (format instanceof PrefixOWLOntologyFormat) {
        prefixes.putAll(((PrefixOWLOntologyFormat)format).getPrefixName2PrefixMap());
        baseURI=prefixes.get("String_Node_Str");
        prefixes.remove("String_Node_Str");
      }
      for (      OWLClass owlClass : classes)       atomicConcepts.add(new NamedClass(owlClass.toStringID()));
      for (      OWLObjectProperty owlProperty : owlObjectProperties)       atomicRoles.add(new ObjectProperty(owlProperty.toStringID()));
      for (      OWLDataProperty owlProperty : owlDatatypeProperties) {
        DatatypeProperty dtp=new DatatypeProperty(owlProperty.toStringID());
        Set<OWLDataRange> ranges=owlProperty.getRanges(allImports);
        Iterator<OWLDataRange> it=ranges.iterator();
        if (it.hasNext()) {
          OWLDataRange range=it.next();
          if (range.isDatatype()) {
            URI uri=((OWLDatatype)range).getIRI().toURI();
            if (uri.equals(Datatype.BOOLEAN.getURI()))             booleanDatatypeProperties.add(dtp);
 else             if (uri.equals(Datatype.DOUBLE.getURI()))             doubleDatatypeProperties.add(dtp);
 else             if (uri.equals(Datatype.INT.getURI()))             intDatatypeProperties.add(dtp);
 else             if (uri.equals(Datatype.STRING.getURI()))             stringDatatypeProperties.add(dtp);
          }
        }
        datatypeProperties.add(dtp);
      }
      for (      OWLNamedIndividual owlIndividual : owlIndividuals) {
        individuals.add(new Individual(owlIndividual.toStringID()));
      }
    }
 else {
      KB kb=source.toKB();
      IRI ontologyIRI=IRI.create("String_Node_Str");
      ontology=null;
      try {
        ontology=manager.createOntology(ontologyIRI);
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
      OWLAPIAxiomConvertVisitor.fillOWLOntology(manager,ontology,kb);
      owlAPIOntologies.add(ontology);
      allImports.add(ontology);
      atomicConcepts.addAll(kb.findAllAtomicConcepts());
      atomicRoles.addAll(kb.findAllAtomicRoles());
      individuals.addAll(kb.findAllIndividuals());
    }
  }
}

Fixed version (ground truth):
public void loadOntologies() throws URISyntaxException, OWLOntologyCreationException {
  Comparator<OWLNamedObject> namedObjectComparator=new Comparator<OWLNamedObject>(){
    public int compare(    OWLNamedObject o1,    OWLNamedObject o2){
      return o1.getIRI().compareTo(o2.getIRI());
    }
  }
;
  Set<OWLClass> classes=new TreeSet<OWLClass>(namedObjectComparator);
  Set<OWLObjectProperty> owlObjectProperties=new TreeSet<OWLObjectProperty>(namedObjectComparator);
  Set<OWLDataProperty> owlDatatypeProperties=new TreeSet<OWLDataProperty>(namedObjectComparator);
  Set<OWLNamedIndividual> owlIndividuals=new TreeSet<OWLNamedIndividual>(namedObjectComparator);
  loadedOntologies=new HashSet<OWLOntology>();
  Set<OWLOntology> allImports=new HashSet<OWLOntology>();
  prefixes=new TreeMap<String,String>();
  for (  KnowledgeSource source : sources) {
    if (source instanceof OWLFile || source instanceof SparqlKnowledgeSource || source instanceof OWLAPIOntology) {
      URL url=null;
      if (source instanceof OWLFile) {
        url=((OWLFile)source).getURL();
      }
      if (source instanceof OWLAPIOntology) {
        ontology=((OWLAPIOntology)source).getOWLOntolgy();
        manager=ontology.getOWLOntologyManager();
      }
 else       if (source instanceof SparqlKnowledgeSource) {
        ontology=((SparqlKnowledgeSource)source).getOWLAPIOntology();
        manager=ontology.getOWLOntologyManager();
      }
 else {
        ontology=manager.loadOntologyFromOntologyDocument(IRI.create(url));
      }
      owlAPIOntologies.add(ontology);
      Set<OWLOntology> imports=manager.getImportsClosure(ontology);
      allImports.addAll(imports);
      loadedOntologies.addAll(imports);
      classes.addAll(ontology.getClassesInSignature(true));
      owlObjectProperties.addAll(ontology.getObjectPropertiesInSignature(true));
      owlDatatypeProperties.addAll(ontology.getDataPropertiesInSignature(true));
      owlIndividuals.addAll(ontology.getIndividualsInSignature(true));
      OWLOntologyFormat format=manager.getOntologyFormat(ontology);
      if (format instanceof PrefixOWLOntologyFormat) {
        prefixes.putAll(((PrefixOWLOntologyFormat)format).getPrefixName2PrefixMap());
        baseURI=prefixes.get("String_Node_Str");
        prefixes.remove("String_Node_Str");
      }
      for (      OWLClass owlClass : classes)       atomicConcepts.add(new NamedClass(owlClass.toStringID()));
      for (      OWLObjectProperty owlProperty : owlObjectProperties)       atomicRoles.add(new ObjectProperty(owlProperty.toStringID()));
      for (      OWLDataProperty owlProperty : owlDatatypeProperties) {
        DatatypeProperty dtp=new DatatypeProperty(owlProperty.toStringID());
        Set<OWLDataRange> ranges=owlProperty.getRanges(allImports);
        Iterator<OWLDataRange> it=ranges.iterator();
        if (it.hasNext()) {
          OWLDataRange range=it.next();
          if (range.isDatatype()) {
            URI uri=((OWLDatatype)range).getIRI().toURI();
            if (uri.equals(Datatype.BOOLEAN.getURI()))             booleanDatatypeProperties.add(dtp);
 else             if (uri.equals(Datatype.DOUBLE.getURI()))             doubleDatatypeProperties.add(dtp);
 else             if (uri.equals(Datatype.INT.getURI()))             intDatatypeProperties.add(dtp);
 else             if (uri.equals(Datatype.STRING.getURI()))             stringDatatypeProperties.add(dtp);
          }
        }
        datatypeProperties.add(dtp);
      }
      for (      OWLNamedIndividual owlIndividual : owlIndividuals) {
        individuals.add(new Individual(owlIndividual.toStringID()));
      }
    }
 else {
      KB kb=source.toKB();
      IRI ontologyIRI=IRI.create("String_Node_Str");
      ontology=null;
      try {
        ontology=manager.createOntology(ontologyIRI);
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
      OWLAPIAxiomConvertVisitor.fillOWLOntology(manager,ontology,kb);
      owlAPIOntologies.add(ontology);
      allImports.add(ontology);
      atomicConcepts.addAll(kb.findAllAtomicConcepts());
      atomicRoles.addAll(kb.findAllAtomicRoles());
      individuals.addAll(kb.findAllIndividuals());
    }
  }
}