Program: 10311
Project: 10311
Buggy source:
/** 
 * Specifies the URI of the ontology containing the background  knowledge and its format. Reads the ontology and sends it to the reasoner.
 * @param ontologyURI The URI of the ontology to use.
 * @param format "RDF/XML" or "N-TRIPLES".
 */
public void readOntology(String ontologyURL,String format) throws OntologyURLNotValid {
  this.currentOntologyURL=ontologyURL;
  p("String_Node_Str" + ontologyURL + "String_Node_Str"+ format);
  try {
    URL ontology=null;
    try {
      ontology=new URL(ontologyURL);
    }
 catch (    MalformedURLException e1) {
      this.removeOntology();
      throw new OntologyURLNotValid("String_Node_Str","String_Node_Str");
    }
    OntologyFileFormat ofFormat;
    if (format.equals("String_Node_Str"))     ofFormat=OntologyFileFormat.RDF_XML;
 else     ofFormat=OntologyFileFormat.N_TRIPLES;
    Map<URL,OntologyFileFormat> m=new HashMap<URL,OntologyFileFormat>();
    m.put(ontology,ofFormat);
    try {
      Config.digReasonerURL=new URL(reasonerURL);
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
    reasoner=Main.createReasoner(new KB(),m);
    rs=new ReasoningService(reasoner);
    Main.autoDetectConceptsAndRoles(rs);
    reasoner.prepareSubsumptionHierarchy();
    if (Config.Refinement.improveSubsumptionHierarchy) {
      try {
        reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy();
      }
 catch (      ReasoningMethodUnsupportedException e) {
        e.printStackTrace();
      }
    }
    p(rs.getSubsumptionHierarchy().toString());
  }
 catch (  Exception e) {
    this.removeOntology();
    throw new OntologyURLNotValid("String_Node_Str","String_Node_Str");
  }
  p("String_Node_Str" + currentOntologyURL);
}

Fixed version (ground truth):
/** 
 * Specifies the URI of the ontology containing the background  knowledge and its format. Reads the ontology and sends it to the reasoner.
 * @param ontologyURI The URI of the ontology to use.
 * @param format "RDF/XML" or "N-TRIPLES".
 */
public void readOntology(String ontologyURL,String format) throws OntologyURLNotValid {
  this.currentOntologyURL=ontologyURL;
  p("String_Node_Str" + ontologyURL + "String_Node_Str"+ format);
  try {
    URL ontology=null;
    try {
      ontology=new URL(ontologyURL);
    }
 catch (    MalformedURLException e1) {
      this.removeOntology();
      throw new OntologyURLNotValid("String_Node_Str","String_Node_Str");
    }
    OntologyFileFormat ofFormat;
    if (format.equals("String_Node_Str"))     ofFormat=OntologyFileFormat.RDF_XML;
 else     ofFormat=OntologyFileFormat.N_TRIPLES;
    Map<URL,OntologyFileFormat> m=new HashMap<URL,OntologyFileFormat>();
    m.put(ontology,ofFormat);
    try {
      Config.digReasonerURL=new URL(reasonerURL);
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
    reasoner=Main.createReasoner(new KB(),m);
    rs=new ReasoningService(reasoner);
    Main.autoDetectConceptsAndRoles(rs);
    reasoner.prepareSubsumptionHierarchy();
    if (Config.Refinement.improveSubsumptionHierarchy) {
      try {
        reasoner.prepareRoleHierarchy();
        reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy();
      }
 catch (      ReasoningMethodUnsupportedException e) {
        e.printStackTrace();
      }
    }
    p(rs.getSubsumptionHierarchy().toString());
  }
 catch (  Exception e) {
    this.removeOntology();
    throw new OntologyURLNotValid("String_Node_Str","String_Node_Str");
  }
  p("String_Node_Str" + currentOntologyURL);
}