Program: 10202
Project: 10202
Buggy source:
@Override public void init(){
  OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
  Comparator<OWLNamedObject> namedObjectComparator=new Comparator<OWLNamedObject>(){
    public int compare(    OWLNamedObject o1,    OWLNamedObject o2){
      return o1.getURI().compareTo(o2.getURI());
    }
  }
;
  Set<OWLClass> classes=new TreeSet<OWLClass>(namedObjectComparator);
  Set<OWLObjectProperty> owlObjectProperties=new TreeSet<OWLObjectProperty>(namedObjectComparator);
  Set<OWLDataProperty> owlDatatypeProperties=new TreeSet<OWLDataProperty>(namedObjectComparator);
  Set<OWLIndividual> owlIndividuals=new TreeSet<OWLIndividual>(namedObjectComparator);
  Set<OWLOntology> allImports=new HashSet<OWLOntology>();
  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();
      }
 else       if (source instanceof SparqlKnowledgeSource) {
        url=((SparqlKnowledgeSource)source).getNTripleURL();
      }
      try {
        if (source instanceof OWLAPIOntology) {
          System.out.println(source instanceof OWLAPIOntology);
          System.out.println("String_Node_Str");
          OWLOntology ontology=((OWLAPIOntology)source).getOWLOntolgy();
          owlAPIOntologies.add(ontology);
          allImports.addAll(manager.getImportsClosure(ontology));
          classes.addAll(ontology.getReferencedClasses());
          owlObjectProperties.addAll(ontology.getReferencedObjectProperties());
          owlDatatypeProperties.addAll(ontology.getReferencedDataProperties());
          owlIndividuals.addAll(ontology.getReferencedIndividuals());
          OWLOntologyFormat format=manager.getOntologyFormat(ontology);
          if (format instanceof NamespaceOWLOntologyFormat) {
            prefixes=((NamespaceOWLOntologyFormat)format).getNamespacesByPrefixMap();
            baseURI=prefixes.get("String_Node_Str");
            prefixes.remove("String_Node_Str");
          }
        }
 else {
          System.out.println("String_Node_Str");
          OWLOntology ontology=manager.loadOntologyFromPhysicalURI(url.toURI());
          owlAPIOntologies.add(ontology);
          allImports.addAll(manager.getImportsClosure(ontology));
          classes.addAll(ontology.getReferencedClasses());
          owlObjectProperties.addAll(ontology.getReferencedObjectProperties());
          owlDatatypeProperties.addAll(ontology.getReferencedDataProperties());
          owlIndividuals.addAll(ontology.getReferencedIndividuals());
          OWLOntologyFormat format=manager.getOntologyFormat(ontology);
          if (format instanceof NamespaceOWLOntologyFormat) {
            prefixes=((NamespaceOWLOntologyFormat)format).getNamespacesByPrefixMap();
            baseURI=prefixes.get("String_Node_Str");
            prefixes.remove("String_Node_Str");
          }
        }
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
catch (      URISyntaxException e) {
        e.printStackTrace();
      }
    }
 else {
      KB kb=source.toKB();
      URI ontologyURI=URI.create("String_Node_Str");
      OWLOntology ontology=null;
      try {
        ontology=manager.createOntology(ontologyURI);
      }
 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());
    }
  }
  if (reasonerType.equals("String_Node_Str")) {
    try {
      reasoner=new uk.ac.manchester.cs.factplusplus.owlapi.Reasoner(manager);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    System.out.println("String_Node_Str");
  }
 else {
    reasoner=new org.mindswap.pellet.owlapi.Reasoner(manager);
    Logger pelletLogger=Logger.getLogger("String_Node_Str");
    pelletLogger.setLevel(Level.WARN);
  }
  try {
    reasoner.loadOntologies(allImports);
    reasoner.classify();
    reasoner.realise();
  }
 catch (  OWLReasonerException e) {
    e.printStackTrace();
  }
  factory=manager.getOWLDataFactory();
  for (  OWLClass owlClass : classes)   atomicConcepts.add(new NamedClass(owlClass.getURI().toString()));
  for (  OWLObjectProperty owlProperty : owlObjectProperties)   atomicRoles.add(new ObjectProperty(owlProperty.getURI().toString()));
  for (  OWLDataProperty owlProperty : owlDatatypeProperties) {
    DatatypeProperty dtp=new DatatypeProperty(owlProperty.getURI().toString());
    Set<OWLDataRange> ranges=owlProperty.getRanges(allImports);
    OWLDataRange range=ranges.iterator().next();
    if (range.isDataType()) {
      URI uri=((OWLDataType)range).getURI();
      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);
    }
    datatypeProperties.add(dtp);
  }
  for (  OWLIndividual owlIndividual : owlIndividuals)   individuals.add(new Individual(owlIndividual.getURI().toString()));
}

Fixed version (ground truth):
@Override public void init(){
  OWLOntologyManager manager=OWLManager.createOWLOntologyManager();
  Comparator<OWLNamedObject> namedObjectComparator=new Comparator<OWLNamedObject>(){
    public int compare(    OWLNamedObject o1,    OWLNamedObject o2){
      return o1.getURI().compareTo(o2.getURI());
    }
  }
;
  Set<OWLClass> classes=new TreeSet<OWLClass>(namedObjectComparator);
  Set<OWLObjectProperty> owlObjectProperties=new TreeSet<OWLObjectProperty>(namedObjectComparator);
  Set<OWLDataProperty> owlDatatypeProperties=new TreeSet<OWLDataProperty>(namedObjectComparator);
  Set<OWLIndividual> owlIndividuals=new TreeSet<OWLIndividual>(namedObjectComparator);
  Set<OWLOntology> allImports=new HashSet<OWLOntology>();
  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();
      }
 else       if (source instanceof SparqlKnowledgeSource) {
        url=((SparqlKnowledgeSource)source).getNTripleURL();
      }
      try {
        if (source instanceof OWLAPIOntology) {
          OWLOntology ontology=((OWLAPIOntology)source).getOWLOntolgy();
          owlAPIOntologies.add(ontology);
          allImports.addAll(manager.getImportsClosure(ontology));
          classes.addAll(ontology.getReferencedClasses());
          owlObjectProperties.addAll(ontology.getReferencedObjectProperties());
          owlDatatypeProperties.addAll(ontology.getReferencedDataProperties());
          owlIndividuals.addAll(ontology.getReferencedIndividuals());
          OWLOntologyFormat format=manager.getOntologyFormat(ontology);
          if (format instanceof NamespaceOWLOntologyFormat) {
            prefixes=((NamespaceOWLOntologyFormat)format).getNamespacesByPrefixMap();
            baseURI=prefixes.get("String_Node_Str");
            prefixes.remove("String_Node_Str");
          }
        }
 else {
          OWLOntology ontology=manager.loadOntologyFromPhysicalURI(url.toURI());
          owlAPIOntologies.add(ontology);
          allImports.addAll(manager.getImportsClosure(ontology));
          classes.addAll(ontology.getReferencedClasses());
          owlObjectProperties.addAll(ontology.getReferencedObjectProperties());
          owlDatatypeProperties.addAll(ontology.getReferencedDataProperties());
          owlIndividuals.addAll(ontology.getReferencedIndividuals());
          OWLOntologyFormat format=manager.getOntologyFormat(ontology);
          if (format instanceof NamespaceOWLOntologyFormat) {
            prefixes=((NamespaceOWLOntologyFormat)format).getNamespacesByPrefixMap();
            baseURI=prefixes.get("String_Node_Str");
            prefixes.remove("String_Node_Str");
          }
        }
      }
 catch (      OWLOntologyCreationException e) {
        e.printStackTrace();
      }
catch (      URISyntaxException e) {
        e.printStackTrace();
      }
    }
 else {
      KB kb=source.toKB();
      URI ontologyURI=URI.create("String_Node_Str");
      OWLOntology ontology=null;
      try {
        ontology=manager.createOntology(ontologyURI);
      }
 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());
    }
  }
  if (reasonerType.equals("String_Node_Str")) {
    try {
      reasoner=new uk.ac.manchester.cs.factplusplus.owlapi.Reasoner(manager);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    System.out.println("String_Node_Str");
  }
 else {
    reasoner=new org.mindswap.pellet.owlapi.Reasoner(manager);
    Logger pelletLogger=Logger.getLogger("String_Node_Str");
    pelletLogger.setLevel(Level.WARN);
  }
  try {
    reasoner.loadOntologies(allImports);
    reasoner.classify();
    reasoner.realise();
  }
 catch (  OWLReasonerException e) {
    e.printStackTrace();
  }
  factory=manager.getOWLDataFactory();
  for (  OWLClass owlClass : classes)   atomicConcepts.add(new NamedClass(owlClass.getURI().toString()));
  for (  OWLObjectProperty owlProperty : owlObjectProperties)   atomicRoles.add(new ObjectProperty(owlProperty.getURI().toString()));
  for (  OWLDataProperty owlProperty : owlDatatypeProperties) {
    DatatypeProperty dtp=new DatatypeProperty(owlProperty.getURI().toString());
    Set<OWLDataRange> ranges=owlProperty.getRanges(allImports);
    OWLDataRange range=ranges.iterator().next();
    if (range.isDataType()) {
      URI uri=((OWLDataType)range).getURI();
      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);
    }
    datatypeProperties.add(dtp);
  }
  for (  OWLIndividual owlIndividual : owlIndividuals)   individuals.add(new Individual(owlIndividual.getURI().toString()));
}