nus-yam/ex-repair huggingface dataset:
Program: 9337
Project: 9337
Buggy source:
@Override public void init() throws ComponentInitException {
  setReasoning(getReasoningString());
  if (sparql != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url.toString());
    sb.append("String_Node_Str").append(URLencodeUTF8.encode(sparql));
    sb.append("String_Node_Str");
    for (    String graph : defaultGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    for (    String graph : namedGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    logger.info(sb.toString());
    try {
      url=new URL(sb.toString());
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
 else   if (url == null) {
    try {
      Path path;
      if (fileName.startsWith("String_Node_Str")) {
        path=Paths.get(fileName);
      }
 else {
        path=Paths.get(baseDir,fileName);
      }
      url=path.normalize().toUri().toURL();
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void init() throws ComponentInitException {
  setReasoning(getReasoningString());
  if (sparql != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url.toString());
    sb.append("String_Node_Str").append(URLencodeUTF8.encode(sparql));
    sb.append("String_Node_Str");
    for (    String graph : defaultGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    for (    String graph : namedGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    logger.info(sb.toString());
    try {
      url=new URL(sb.toString());
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
 else   if (url == null) {
    try {
      Path path=Paths.get(fileName);
      if (!path.isAbsolute() && baseDir != null) {
        path=Paths.get(baseDir,fileName);
      }
      url=path.normalize().toUri().toURL();
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 9340
Project: 9340
Buggy source:
private void initDatatypes(){
  Set<OWLDataProperty> numericDataProperties=new HashSet<>();
  for (  OWLDataProperty dataProperty : datatypeProperties) {
    Collection<OWLDataRange> ranges=EntitySearcher.getRanges(dataProperty,owlAPIOntologies);
    Iterator<OWLDataRange> it=ranges.iterator();
    if (it.hasNext()) {
      OWLDataRange range=it.next();
      if (range.isDatatype()) {
        OWLDatatype datatype=range.asOWLDatatype();
        if (datatype.isBuiltIn()) {
          datatype2Properties.put(range.asOWLDatatype(),dataProperty);
          dataproperty2datatype.put(dataProperty,range.asOWLDatatype());
          if (OWLAPIUtils.isNumericDatatype(range.asOWLDatatype())) {
            numericDataProperties.add(dataProperty);
          }
        }
 else         if (OWLAPIUtils.dtDatatypes.contains(datatype)) {
          datatype2Properties.put(range.asOWLDatatype(),dataProperty);
          dataproperty2datatype.put(dataProperty,range.asOWLDatatype());
        }
 else {
        }
      }
 else {
      }
    }
 else {
    }
  }
}

Fixed version (ground truth):
private void initDatatypes(){
  Set<OWLDataProperty> numericDataProperties=new HashSet<>();
  for (  OWLDataProperty dataProperty : datatypeProperties) {
    Collection<OWLDataRange> ranges=EntitySearcher.getRanges(dataProperty,ontology);
    Iterator<OWLDataRange> it=ranges.iterator();
    if (it.hasNext()) {
      OWLDataRange range=it.next();
      if (range.isDatatype()) {
        OWLDatatype datatype=range.asOWLDatatype();
        if (datatype.isBuiltIn()) {
          datatype2Properties.put(range.asOWLDatatype(),dataProperty);
          dataproperty2datatype.put(dataProperty,range.asOWLDatatype());
          if (OWLAPIUtils.isNumericDatatype(range.asOWLDatatype())) {
            numericDataProperties.add(dataProperty);
          }
        }
 else         if (OWLAPIUtils.dtDatatypes.contains(datatype)) {
          datatype2Properties.put(range.asOWLDatatype(),dataProperty);
          dataproperty2datatype.put(dataProperty,range.asOWLDatatype());
        }
 else {
        }
      }
 else {
      }
    }
 else {
    }
  }
}
Program: 9343
Project: 9343
Buggy source:
@Override public void init() throws ComponentInitException {
  super.init();
  bundle.setBddFType(bddFType);
  bundle.setMaxExplanations(this.maxExplanations);
  bundle.setMaxTime(this.timeout);
  bundle.setLog(true);
  bundle.setAccuracy(this.accuracy);
  bundle.loadOntologies(ontology);
  initialized=true;
}

Fixed version (ground truth):
@Override public void init() throws ComponentInitException {
  super.init();
  bundle.setBddFType(bddFType);
  bundle.setMaxExplanations(this.maxExplanations);
  bundle.setMaxTime(this.timeout);
  bundle.setLog(true);
  bundle.setAccuracy(this.accuracy);
  bundle.loadOntologies(ontology);
  bundle.init();
  initialized=true;
}
Program: 9344
Project: 9344
Buggy source:
@Override public OWLProbExplanationReasonerResult computeQuery(OWLAxiom axiom) throws OWLException {
  QueryResult result=bundle.computeQuery(axiom);
  return new OWLProbExplanationReasonerResult(axiom,result.getQueryProbability().doubleValue(),GeneralUtils.safe(result.getExplanations()));
}

Fixed version (ground truth):
@Override public OWLProbReasonerResult computeQuery(OWLAxiom axiom) throws OWLException {
  return computeQueryWithExplanations(axiom);
}
Program: 9347
Project: 9347
Buggy source:
final public String String() throws ParseException {
  Token t;
  String s;
  t=jj_consume_token(STRING);
  s=t.image;
  s=s.substring(1,s.length() - 1);
  try {
    s=java.net.URLDecoder.decode(s,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
  }
{
    if ("String_Node_Str" != null)     return s;
  }
  throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final public String String() throws ParseException {
  Token t;
  String s;
  t=jj_consume_token(STRING);
  s=t.image;
  s=s.substring(1,s.length() - 1);
  try {
    s=java.net.URLDecoder.decode(s,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
  }
catch (  IllegalArgumentException e) {
  }
{
    if ("String_Node_Str" != null)     return s;
  }
  throw new Error("String_Node_Str");
}
Program: 9348
Project: 9348
Buggy source:
@Override public boolean isTooWeak(){
  return isTooWeak;
}

Fixed version (ground truth):
public boolean isTooWeak(){
  return isTooWeak;
}
Program: 9350
Project: 9350
Buggy source:
public void correctness(){
  treeFactory.setMaxDepth(2);
  treeFactory.addDropFilters((Filter<Statement>[])new DBpediaEvaluationDataset(SparqlEndpoint.getEndpointDBpedia()).getQueryTreeFilters().toArray(new Filter[]{}));
  Model model=ModelFactory.createDefaultModel();
  RDFDataMgr.read(model,this.getClass().getClassLoader().getResourceAsStream("String_Node_Str"),Lang.TURTLE);
  RDFResourceTree tree1=treeFactory.getQueryTree("String_Node_Str",model);
  model=ModelFactory.createDefaultModel();
  RDFDataMgr.read(model,this.getClass().getClassLoader().getResourceAsStream("String_Node_Str"),Lang.TURTLE);
  RDFResourceTree tree2=treeFactory.getQueryTree("String_Node_Str",model);
  long start=System.currentTimeMillis();
  RDFResourceTree lggSimple=lggGenSimple.getLGG(tree1,tree2);
  long end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (end - start) + "String_Node_Str");
  System.out.println(lggSimple.getStringRepresentation());
}

Fixed version (ground truth):
public void correctness(){
  treeFactory.setMaxDepth(2);
  treeFactory.addDropFilters((Filter<Statement>[])new DBpediaEvaluationDataset(new File("String_Node_Str"),SparqlEndpoint.getEndpointDBpedia()).getQueryTreeFilters().toArray(new Filter[]{}));
  Model model=ModelFactory.createDefaultModel();
  RDFDataMgr.read(model,this.getClass().getClassLoader().getResourceAsStream("String_Node_Str"),Lang.TURTLE);
  RDFResourceTree tree1=treeFactory.getQueryTree("String_Node_Str",model);
  model=ModelFactory.createDefaultModel();
  RDFDataMgr.read(model,this.getClass().getClassLoader().getResourceAsStream("String_Node_Str"),Lang.TURTLE);
  RDFResourceTree tree2=treeFactory.getQueryTree("String_Node_Str",model);
  long start=System.currentTimeMillis();
  RDFResourceTree lggSimple=lggGenSimple.getLGG(tree1,tree2);
  long end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (end - start) + "String_Node_Str");
  System.out.println(lggSimple.getStringRepresentation());
}
Program: 9352
Project: 9352
Buggy source:
private static void configureClassLP(ClassLearningProblem problem,OWLClass classToDescribe,HeuristicType accuracyMethod,boolean equivalenceLearning,boolean useApproximations,double approxAccuracy) throws ComponentInitException {
  problem.setClassToDescribe(classToDescribe);
  problem.setEquivalence(equivalenceLearning);
  problem.setHeuristic(accuracyMethod);
  problem.setUseApproximations(useApproximations);
  problem.setApproxDelta(approxAccuracy);
  problem.init();
}

Fixed version (ground truth):
private static void configureClassLP(ClassLearningProblem problem,OWLClass classToDescribe,HeuristicType accuracyMethod,boolean equivalenceLearning,boolean useApproximations,double approxAccuracy) throws ComponentInitException {
  problem.setClassToDescribe(classToDescribe);
  problem.setEquivalence(equivalenceLearning);
  problem.setAccuracyMethod(accuracyMethod);
  problem.setUseApproximations(useApproximations);
  problem.setApproxDelta(approxAccuracy);
  problem.init();
}
Program: 9355
Project: 9355
Buggy source:
public Enrichment(SparqlEndpointKS ks,OWLEntity resource,double threshold,int nrOfAxiomsToLearn,boolean useInference,boolean verbose,int chunksize,int maxExecutionTimeInSeconds,boolean omitExistingAxioms){
  this.ks=ks;
  this.resource=resource;
  this.verbose=verbose;
  this.threshold=threshold;
  this.nrOfAxiomsToLearn=nrOfAxiomsToLearn;
  this.useInference=useInference;
  this.chunksize=chunksize;
  this.maxExecutionTimeInSeconds=maxExecutionTimeInSeconds;
  this.omitExistingAxioms=omitExistingAxioms;
  if (ks.isRemote()) {
    try {
      cacheDir="String_Node_Str" + File.separator + URLEncoder.encode(ks.getEndpoint().getURL().toString(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
  classAlgorithms=new LinkedList<Class<? extends LearningAlgorithm>>();
  classAlgorithms.add(CELOE.class);
  algorithmRuns=new LinkedList<AlgorithmRun>();
  learnedOWLAxioms=new HashSet<OWLAxiom>();
  learnedEvaluatedAxioms=new HashSet<EvaluatedAxiom>();
}

Fixed version (ground truth):
public Enrichment(SparqlEndpointKS ks,OWLEntity resource,double threshold,int nrOfAxiomsToLearn,boolean useInference,boolean verbose,int chunksize,int maxExecutionTimeInSeconds,boolean omitExistingAxioms){
  this.ks=ks;
  this.resource=resource;
  this.verbose=verbose;
  this.threshold=threshold;
  this.nrOfAxiomsToLearn=nrOfAxiomsToLearn;
  this.useInference=useInference;
  this.chunksize=chunksize;
  this.maxExecutionTimeInSeconds=maxExecutionTimeInSeconds;
  this.omitExistingAxioms=omitExistingAxioms;
  try {
    ks.init();
  }
 catch (  ComponentInitException e1) {
    e1.printStackTrace();
  }
  if (ks.isRemote()) {
    try {
      cacheDir="String_Node_Str" + File.separator + URLEncoder.encode(ks.getEndpoint().getURL().toString(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
  classAlgorithms=new LinkedList<Class<? extends LearningAlgorithm>>();
  classAlgorithms.add(CELOE.class);
  algorithmRuns=new LinkedList<AlgorithmRun>();
  learnedOWLAxioms=new HashSet<OWLAxiom>();
  learnedEvaluatedAxioms=new HashSet<EvaluatedAxiom>();
}
Program: 9357
Project: 9357
Buggy source:
/** 
 * Set the file-based cache directory. Default is the temporary folder of the operating system retrieved by using java.io.tmpdir,  i.e. in most cases <table> <tr><th>OS</th><th>Directory</th></tr> <tr><td>Linux</td><td>/tmp/</td></tr> <tr><td>Windows</td><td>C:\temp</td></tr> </table>
 * @param cacheDir the absolute cache directory path
 */
public void setCacheDir(String cacheDir){
  this.cacheDir=cacheDir;
}

Fixed version (ground truth):
/** 
 * Set the file-based cache directory. Default is the temporary folder of the operating system retrieved by using java.io.tmpdir, i.e. in most cases <table> <tr><th>OS</th><th>Directory</th></tr> <tr><td>Linux</td><td>/tmp/</td></tr> <tr><td>Windows</td><td>C:\temp</td></tr> </table>
 * @param cacheDir the absolute cache directory path
 */
public void setCacheDir(String cacheDir){
  this.cacheDir=cacheDir;
}
Program: 9358
Project: 9358
Buggy source:
@Override public String toString(){
  String out=String.format("String_Node_Str","String_Node_Str","String_Node_Str");
  out+=String.format("String_Node_Str","String_Node_Str",qef.getId());
  out+=String.format("String_Node_Str","String_Node_Str",cacheDir);
  out+=String.format("String_Node_Str","String_Node_Str",queryDelay);
  return out;
}

Fixed version (ground truth):
@Override public String toString(){
  String out=String.format("String_Node_Str","String_Node_Str","String_Node_Str");
  if (qef != null) {
    out+=String.format("String_Node_Str","String_Node_Str",qef.getId());
  }
 else {
    out+=String.format("String_Node_Str","String_Node_Str","String_Node_Str");
  }
  out+=String.format("String_Node_Str","String_Node_Str",cacheDir);
  out+=String.format("String_Node_Str","String_Node_Str",queryDelay);
  return out;
}
Program: 9359
Project: 9359
Buggy source:
public void setBaseDir(String baseDir){
  if (baseDir.startsWith("String_Node_Str"))   baseDir=baseDir.substring(5);
  this.baseDir=baseDir;
}

Fixed version (ground truth):
public void setBaseDir(String baseDir){
  this.baseDir=baseDir;
}
Program: 9360
Project: 9360
Buggy source:
/** 
 * @param args
 * @throws ParseException 
 * @throws IOException 
 * @throws ReasoningMethodUnsupportedException 
 */
public static void main(String[] args) throws ParseException, IOException, ReasoningMethodUnsupportedException {
  System.out.println("String_Node_Str");
  if (args.length == 0) {
    System.out.println("String_Node_Str");
    System.exit(0);
  }
  File file=new File(args[args.length - 1]);
  if (!file.exists()) {
    System.out.println("String_Node_Str" + file + "String_Node_Str");
    System.exit(0);
  }
  Resource confFile=new FileSystemResource(file);
  List<Resource> springConfigResources=new ArrayList<Resource>();
  try {
    IConfiguration configuration=new ConfParserConfiguration(confFile);
    ApplicationContextBuilder builder=new DefaultApplicationContextBuilder();
    ApplicationContext context=builder.buildApplicationContext(configuration,springConfigResources);
    CLI cli;
    if (context.containsBean("String_Node_Str")) {
      cli=(CLI)context.getBean("String_Node_Str");
    }
 else {
      cli=new CLI();
    }
    cli.setContext(context);
    cli.setConfFile(file);
    cli.run();
  }
 catch (  Exception e) {
    e.printStackTrace();
    String stacktraceFileName="String_Node_Str";
    Throwable primaryCause=findPrimaryCause(e);
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e);
    logger.error("String_Node_Str" + stacktraceFileName);
    FileOutputStream fos=new FileOutputStream(stacktraceFileName);
    PrintStream ps=new PrintStream(fos);
    e.printStackTrace(ps);
  }
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws ParseException 
 * @throws IOException 
 * @throws ReasoningMethodUnsupportedException 
 */
public static void main(String[] args) throws ParseException, IOException, ReasoningMethodUnsupportedException {
  System.out.println("String_Node_Str");
  if (args.length == 0) {
    System.out.println("String_Node_Str");
    System.exit(0);
  }
  File file=new File(args[args.length - 1]);
  if (!file.exists()) {
    System.out.println("String_Node_Str" + file + "String_Node_Str");
    System.exit(0);
  }
  Resource confFile=new FileSystemResource(file);
  List<Resource> springConfigResources=new ArrayList<Resource>();
  try {
    IConfiguration configuration=new ConfParserConfiguration(confFile);
    ApplicationContextBuilder builder=new DefaultApplicationContextBuilder();
    ApplicationContext context=builder.buildApplicationContext(configuration,springConfigResources);
    CLI cli;
    if (context.containsBean("String_Node_Str")) {
      cli=(CLI)context.getBean("String_Node_Str");
    }
 else {
      cli=new CLI();
    }
    cli.setContext(context);
    cli.setConfFile(file);
    cli.run();
  }
 catch (  Exception e) {
    String stacktraceFileName="String_Node_Str";
    Throwable primaryCause=findPrimaryCause(e);
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e);
    logger.error("String_Node_Str" + stacktraceFileName);
    FileOutputStream fos=new FileOutputStream(stacktraceFileName);
    PrintStream ps=new PrintStream(fos);
    e.printStackTrace(ps);
  }
}
Program: 9361
Project: 9361
Buggy source:
public ConfParserConfiguration(Resource source){
  try {
    if (!(source instanceof InputStreamResource)) {
      baseDir=source.getFile().getAbsoluteFile().getParentFile().toURI().toString();
    }
 else {
      baseDir=null;
    }
    parser=new ConfParser(source.getInputStream());
    parser.Start();
    Rendering rendering=Rendering.MANCHESTER_SYNTAX;
    ConfFileOption renderingOption=parser.getConfOptionsByProperty("String_Node_Str");
    if (renderingOption != null) {
      String syntax=renderingOption.getPropertyValue();
      for (      Rendering r : Rendering.values()) {
        if (syntax.equals(r.getName())) {
          rendering=r;
        }
      }
    }
    ToStringRenderer.getInstance().setRenderer(rendering.getRenderer());
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public ConfParserConfiguration(Resource source){
  try {
    if (!(source instanceof InputStreamResource)) {
      baseDir=source.getFile().getAbsoluteFile().getParentFile().getAbsolutePath();
    }
 else {
      baseDir=null;
    }
    parser=new ConfParser(source.getInputStream());
    parser.Start();
    Rendering rendering=Rendering.MANCHESTER_SYNTAX;
    ConfFileOption renderingOption=parser.getConfOptionsByProperty("String_Node_Str");
    if (renderingOption != null) {
      String syntax=renderingOption.getPropertyValue();
      for (      Rendering r : Rendering.values()) {
        if (syntax.equals(r.getName())) {
          rendering=r;
        }
      }
    }
    ToStringRenderer.getInstance().setRenderer(rendering.getRenderer());
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 9362
Project: 9362
Buggy source:
@Override public void init() throws ComponentInitException {
  setReasoning(getReasoningString());
  if (sparql != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url.toString());
    sb.append("String_Node_Str").append(URLencodeUTF8.encode(sparql));
    sb.append("String_Node_Str");
    for (    String graph : defaultGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    for (    String graph : namedGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    logger.info(sb.toString());
    try {
      url=new URL(sb.toString());
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
 else   if (url == null) {
    try {
      Path path;
      if (fileName.startsWith("String_Node_Str")) {
        path=Paths.get(fileName);
      }
 else {
        path=Paths.get(baseDir,fileName);
      }
      System.out.println(path);
      System.out.println(path.normalize());
      System.out.println(path.normalize().toUri());
      url=path.normalize().toUri().toURL();
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void init() throws ComponentInitException {
  setReasoning(getReasoningString());
  if (sparql != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url.toString());
    sb.append("String_Node_Str").append(URLencodeUTF8.encode(sparql));
    sb.append("String_Node_Str");
    for (    String graph : defaultGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    for (    String graph : namedGraphURIs) {
      sb.append("String_Node_Str").append(URLencodeUTF8.encode(graph));
    }
    logger.info(sb.toString());
    try {
      url=new URL(sb.toString());
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
 else   if (url == null) {
    try {
      Path path;
      if (fileName.startsWith("String_Node_Str")) {
        path=Paths.get(fileName);
      }
 else {
        path=Paths.get(baseDir,fileName);
      }
      url=path.normalize().toUri().toURL();
    }
 catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 9363
Project: 9363
Buggy source:
public void setBaseDir(String baseDir){
  this.baseDir=baseDir;
}

Fixed version (ground truth):
public void setBaseDir(String baseDir){
  if (baseDir.startsWith("String_Node_Str"))   baseDir=baseDir.substring(5);
  this.baseDir=baseDir;
}
Program: 9364
Project: 9364
Buggy source:
private <T extends Number & Comparable<T>>List<T> computeSplitValues(OWLDataProperty dp){
  Set<T> valuesSet=new TreeSet<T>();
  Map<OWLIndividual,SortedSet<T>> ind2Values=reasoner.getNumericDatatypeMembers(dp);
  for (  Entry<OWLIndividual,SortedSet<T>> e : ind2Values.entrySet()) {
    valuesSet.addAll(e.getValue());
  }
  List<T> values=new LinkedList<T>(valuesSet);
  Collections.sort(values);
  int nrOfValues=values.size();
  List<T> splitsDP=new LinkedList<T>();
  for (int splitNr=0; splitNr < Math.min(maxNrOfSplits,nrOfValues - 1); splitNr++) {
    int index;
    if (nrOfValues <= maxNrOfSplits) {
      index=splitNr;
    }
 else {
      index=(int)Math.floor(splitNr * (double)nrOfValues / (maxNrOfSplits + 1));
    }
    index=Math.max(0,(int)Math.floor(splitNr * (double)nrOfValues / (maxNrOfSplits) - 1));
    T number1=values.get(index);
    T number2=values.get(index + 1);
    T avg=avg(number1,number2);
    splitsDP.add(avg);
  }
  if (nrOfValues > 0)   splitsDP.add(values.get(nrOfValues - 1));
  return splitsDP;
}

Fixed version (ground truth):
private <T extends Number & Comparable<T>>List<T> computeSplitValues(OWLDataProperty dp){
  Set<T> valuesSet=new TreeSet<T>();
  Map<OWLIndividual,SortedSet<T>> ind2Values=reasoner.getNumericDatatypeMembers(dp);
  for (  Entry<OWLIndividual,SortedSet<T>> e : ind2Values.entrySet()) {
    valuesSet.addAll(e.getValue());
  }
  List<T> values=new LinkedList<T>(valuesSet);
  Collections.sort(values);
  int nrOfValues=values.size();
  List<T> splitsDP=new LinkedList<T>();
  if (nrOfValues > 0) {
    splitsDP.add(values.get(0));
  }
  for (int splitNr=0; splitNr < Math.min(maxNrOfSplits,nrOfValues - 1); splitNr++) {
    int index;
    if (nrOfValues <= maxNrOfSplits) {
      index=splitNr;
    }
 else {
      index=(int)Math.floor(splitNr * (double)nrOfValues / (maxNrOfSplits + 1));
    }
    index=Math.max(index,(int)Math.floor(splitNr * (double)nrOfValues / (maxNrOfSplits) - 1));
    T number1=values.get(index);
    T number2=values.get(index + 1);
    T avg=avg(number1,number2);
    splitsDP.add(avg);
  }
  if (nrOfValues > 1)   splitsDP.add(values.get(nrOfValues - 1));
  return splitsDP;
}
Program: 9365
Project: 9365
Buggy source:
/** 
 * Applies all special directives by modifying the conf options.
 */
public void applyAll(){
  ConfFileOption2 prefixOption=directives.get("String_Node_Str");
  Map<String,String> prefixes=new TreeMap<>();
  prefixes.put("String_Node_Str",OWL.NS);
  prefixes.put("String_Node_Str",RDFS.getURI());
  prefixes.put("String_Node_Str",RDF.getURI());
  if (prefixOption != null) {
    prefixes.putAll((Map<String,String>)prefixOption.getValueObject());
  }
  for (  ConfFileOption2 option : confOptions) {
    Object valueObject=option.getValue();
    if (valueObject instanceof String) {
      for (      String prefix : prefixes.keySet()) {
        valueObject=((String)valueObject).replaceAll(prefix + "String_Node_Str",prefixes.get(prefix));
      }
    }
 else     if (valueObject instanceof Map) {
      valueObject=processStringMap(prefixes,(Map)valueObject);
    }
 else     if (valueObject instanceof Collection) {
      processStringCollection(prefixes,(Collection<?>)valueObject);
    }
 else     if (valueObject instanceof Boolean || valueObject instanceof Integer || valueObject instanceof Double) {
    }
 else {
      throw new Error("String_Node_Str" + valueObject.getClass());
    }
    option.setValueObject(valueObject);
  }
}

Fixed version (ground truth):
/** 
 * Applies all special directives by modifying the conf options.
 */
public void applyAll(){
  ConfFileOption2 prefixOption=directives.get("String_Node_Str");
  Map<String,String> prefixes=new TreeMap<>();
  prefixes.put("String_Node_Str",OWL.NS);
  prefixes.put("String_Node_Str",RDFS.getURI());
  prefixes.put("String_Node_Str",RDF.getURI());
  if (prefixOption != null) {
    prefixes.putAll((Map<String,String>)prefixOption.getValueObject());
  }
  for (  ConfFileOption2 option : confOptions) {
    Object valueObject=option.getValue();
    if (valueObject instanceof String) {
      String oldValue=(String)valueObject;
      for (      String prefix : prefixes.keySet()) {
        valueObject=oldValue.replaceAll(prefix + "String_Node_Str",prefixes.get(prefix));
        if (!oldValue.equals(valueObject))         break;
      }
    }
 else     if (valueObject instanceof Map) {
      valueObject=processStringMap(prefixes,(Map)valueObject);
    }
 else     if (valueObject instanceof Collection) {
      processStringCollection(prefixes,(Collection<?>)valueObject);
    }
 else     if (valueObject instanceof Boolean || valueObject instanceof Integer || valueObject instanceof Double) {
    }
 else {
      throw new Error("String_Node_Str" + valueObject.getClass());
    }
    option.setValueObject(valueObject);
  }
}
Program: 9366
Project: 9366
Buggy source:
private Map processStringMap(Map<String,String> prefixes,Map inputMap){
  Map newMap=new HashMap();
  for (  Object keyObject : inputMap.keySet()) {
    Object key=keyObject;
    Object value=inputMap.get(key);
    if (keyObject instanceof String) {
      String keyString=(String)keyObject;
      for (      String prefix : prefixes.keySet()) {
        key=keyString.replaceAll(prefix + "String_Node_Str",prefixes.get(prefix));
      }
      if (value instanceof String) {
        String valueString=(String)value;
        for (        String prefix : prefixes.keySet()) {
          value=valueString.replaceAll(prefix + "String_Node_Str",prefixes.get(prefix));
        }
      }
    }
    newMap.put(key,value);
  }
  return newMap;
}

Fixed version (ground truth):
private Map processStringMap(Map<String,String> prefixes,Map inputMap){
  Map newMap=new HashMap();
  for (  Object keyObject : inputMap.keySet()) {
    Object key=keyObject;
    Object value=inputMap.get(key);
    if (keyObject instanceof String) {
      String keyString=(String)keyObject;
      for (      String prefix : prefixes.keySet()) {
        key=keyString.replaceAll(prefix + "String_Node_Str",prefixes.get(prefix));
        if (!key.equals(keyString))         break;
      }
      if (value instanceof String) {
        String valueString=(String)value;
        for (        String prefix : prefixes.keySet()) {
          value=valueString.replaceAll(prefix + "String_Node_Str",prefixes.get(prefix));
          if (!value.equals(valueString))           break;
        }
      }
    }
    newMap.put(key,value);
  }
  return newMap;
}
Program: 9367
Project: 9367
Buggy source:
public boolean isSymmetric(OWLObjectProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL2.SymmetricProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isSymmetric(OWLObjectProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL2.SymmetricProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9368
Project: 9368
Buggy source:
public boolean isTransitive(OWLObjectProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL2.TransitiveProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isTransitive(OWLObjectProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL2.TransitiveProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9369
Project: 9369
Buggy source:
public boolean isFunctional(OWLDataProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL.FunctionalProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isFunctional(OWLDataProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL.FunctionalProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9370
Project: 9370
Buggy source:
public boolean isIrreflexive(OWLObjectProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL2.IrreflexiveProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isIrreflexive(OWLObjectProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL2.IrreflexiveProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9371
Project: 9371
Buggy source:
public boolean isInverseFunctional(OWLObjectProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL.InverseFunctionalProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isInverseFunctional(OWLObjectProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL.InverseFunctionalProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9372
Project: 9372
Buggy source:
public boolean isAsymmetric(OWLObjectProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL2.AsymmetricProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isAsymmetric(OWLObjectProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL2.AsymmetricProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9373
Project: 9373
Buggy source:
public boolean isReflexive(OWLObjectProperty property){
  String query="String_Node_Str" + property + "String_Node_Str"+ OWL2.ReflexiveProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}

Fixed version (ground truth):
public boolean isReflexive(OWLObjectProperty property){
  String query="String_Node_Str" + property.toStringID() + "String_Node_Str"+ OWL2.ReflexiveProperty.getURI()+ "String_Node_Str";
  return qef.createQueryExecution(query).execAsk();
}
Program: 9374
Project: 9374
Buggy source:
private boolean isDescriptionAllowed(OWLClassExpression description){
  if (isEquivalenceProblem) {
    if (occursOnFirstLevel(description,classToDescribe)) {
      return false;
    }
    TreeSet<OWLClassExpression> toTest=new TreeSet<OWLClassExpression>();
    if (classToDescribe != null) {
      toTest.add(classToDescribe);
    }
    while (!toTest.isEmpty()) {
      OWLClassExpression d=toTest.pollFirst();
      if (occursOnFirstLevel(description,d)) {
        return false;
      }
      toTest.addAll(reasoner.getEquivalentClasses(d));
    }
  }
 else {
    TreeSet<OWLClassExpression> toTest=new TreeSet<OWLClassExpression>();
    if (classToDescribe != null) {
      toTest.add(classToDescribe);
    }
    while (!toTest.isEmpty()) {
      OWLClassExpression d=toTest.pollFirst();
      if (occursOnFirstLevel(description,d)) {
        return false;
      }
      toTest.addAll(reasoner.getClassHierarchy().getSuperClasses(d));
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isDescriptionAllowed(OWLClassExpression description){
  if (learningProblem instanceof ClassLearningProblem) {
    if (isEquivalenceProblem) {
      if (occursOnFirstLevel(description,classToDescribe)) {
        return false;
      }
      TreeSet<OWLClassExpression> toTest=new TreeSet<OWLClassExpression>();
      if (classToDescribe != null) {
        toTest.add(classToDescribe);
      }
      while (!toTest.isEmpty()) {
        OWLClassExpression d=toTest.pollFirst();
        if (occursOnFirstLevel(description,d)) {
          return false;
        }
        toTest.addAll(reasoner.getEquivalentClasses(d));
      }
    }
 else {
      TreeSet<OWLClassExpression> toTest=new TreeSet<OWLClassExpression>();
      if (classToDescribe != null) {
        toTest.add(classToDescribe);
      }
      while (!toTest.isEmpty()) {
        OWLClassExpression d=toTest.pollFirst();
        if (occursOnFirstLevel(description,d)) {
          return false;
        }
        toTest.addAll(reasoner.getClassHierarchy().getSuperClasses(d));
      }
    }
    return true;
  }
  return true;
}
Program: 9375
Project: 9375
Buggy source:
@Override public void init() throws ComponentInitException {
  if (heuristic == null) {
    heuristic=new StableHeuristic();
  }
  candidates=new TreeSet<SearchTreeNode>(heuristic);
  if (ignoredConcepts != null) {
    Set<OWLClass> usedConcepts=Helper.computeConceptsUsingIgnoreList(reasoner,ignoredConcepts);
    ClassHierarchy classHierarchy=(ClassHierarchy)reasoner.getClassHierarchy().cloneAndRestrict(new HashSet<OWLClassExpression>(usedConcepts));
    classHierarchy.thinOutSubsumptionHierarchy();
  }
  operator=new ELDown3(reasoner,instanceBasedDisjoints);
  operator.setMaxClassExpressionDepth(maxClassExpressionDepth);
  noise=noisePercentage / 100d;
  bestEvaluatedDescriptions=new EvaluatedDescriptionSet(maxNrOfResults);
}

Fixed version (ground truth):
@Override public void init() throws ComponentInitException {
  if (heuristic == null) {
    heuristic=new StableHeuristic();
  }
  candidates=new TreeSet<SearchTreeNode>(heuristic);
  if (ignoredConcepts != null) {
    Set<OWLClass> usedConcepts=Helper.computeConceptsUsingIgnoreList(reasoner,ignoredConcepts);
    ClassHierarchy classHierarchy=(ClassHierarchy)reasoner.getClassHierarchy().cloneAndRestrict(new HashSet<OWLClassExpression>(usedConcepts));
    classHierarchy.thinOutSubsumptionHierarchy();
  }
  operator=new ELDown3(reasoner,instanceBasedDisjoints);
  operator.setMaxClassExpressionDepth(maxClassExpressionDepth);
  noise=noisePercentage / 100d;
  bestEvaluatedDescriptions=new EvaluatedDescriptionSet(maxNrOfResults);
  timeMonitor=MonitorFactory.getTimeMonitor("String_Node_Str");
}
Program: 9376
Project: 9376
Buggy source:
public ELLearningAlgorithm(AbstractLearningProblem problem,AbstractReasonerComponent reasoner){
  super(problem,reasoner);
  timeMonitor=MonitorFactory.getTimeMonitor("String_Node_Str");
}

Fixed version (ground truth):
public ELLearningAlgorithm(AbstractLearningProblem problem,AbstractReasonerComponent reasoner){
  super(problem,reasoner);
}
Program: 9377
Project: 9377
Buggy source:
public Set<OWLObjectProperty> getObjectProperties(OWLClass cls){
  Set<OWLObjectProperty> properties=new TreeSet<>();
  String query="String_Node_Str" + cls + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    properties.add(df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI())));
  }
  return properties;
}

Fixed version (ground truth):
public Set<OWLObjectProperty> getObjectProperties(OWLClass cls){
  Set<OWLObjectProperty> properties=new TreeSet<>();
  String query="String_Node_Str" + cls.toStringID() + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    properties.add(df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI())));
  }
  return properties;
}
Program: 9378
Project: 9378
Buggy source:
public Set<OWLObjectProperty> getObjectPropertiesWithDomain(OWLClass domain){
  Set<OWLObjectProperty> properties=new TreeSet<>();
  String query="String_Node_Str" + domain + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    properties.add(df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI())));
  }
  return properties;
}

Fixed version (ground truth):
public Set<OWLObjectProperty> getObjectPropertiesWithDomain(OWLClass domain){
  Set<OWLObjectProperty> properties=new TreeSet<>();
  String query="String_Node_Str" + domain.toStringID() + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    properties.add(df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI())));
  }
  return properties;
}
Program: 9379
Project: 9379
Buggy source:
@Override public Map<OWLObjectProperty,OWLClassExpression> getObjectPropertyRanges(){
  Map<OWLObjectProperty,OWLClassExpression> result=new HashMap<>();
  String query=SPARQLQueryUtils.PREFIXES + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  while (rs.hasNext()) {
    QuerySolution qs=rs.next();
    OWLObjectProperty op=df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI()));
    OWLClassExpression range=df.getOWLClass(IRI.create(qs.getResource("String_Node_Str").getURI()));
    result.put(op,range);
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<OWLObjectProperty,OWLClassExpression> getObjectPropertyRanges(){
  Map<OWLObjectProperty,OWLClassExpression> result=new HashMap<>();
  String query=SPARQLQueryUtils.PREFIXES + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  while (rs.hasNext()) {
    QuerySolution qs=rs.next();
    OWLObjectProperty op=df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI()));
    OWLClassExpression range=df.getOWLThing();
    if (qs.get("String_Node_Str") != null) {
      range=df.getOWLClass(IRI.create(qs.getResource("String_Node_Str").getURI()));
    }
    result.put(op,range);
  }
  return result;
}
Program: 9380
Project: 9380
Buggy source:
@Override public Map<OWLDataProperty,OWLClassExpression> getDataPropertyDomains(){
  Map<OWLDataProperty,OWLClassExpression> result=new HashMap<>();
  String query=SPARQLQueryUtils.PREFIXES + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  while (rs.hasNext()) {
    QuerySolution qs=rs.next();
    OWLDataProperty dp=df.getOWLDataProperty(IRI.create(qs.getResource("String_Node_Str").getURI()));
    OWLClassExpression domain=df.getOWLClass(IRI.create(qs.getResource("String_Node_Str").getURI()));
    result.put(dp,domain);
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<OWLDataProperty,OWLClassExpression> getDataPropertyDomains(){
  Map<OWLDataProperty,OWLClassExpression> result=new HashMap<>();
  String query=SPARQLQueryUtils.PREFIXES + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  while (rs.hasNext()) {
    QuerySolution qs=rs.next();
    OWLDataProperty dp=df.getOWLDataProperty(IRI.create(qs.getResource("String_Node_Str").getURI()));
    OWLClassExpression domain=df.getOWLThing();
    if (qs.get("String_Node_Str") != null) {
      domain=df.getOWLClass(IRI.create(qs.getResource("String_Node_Str").getURI()));
    }
    result.put(dp,domain);
  }
  return result;
}
Program: 9381
Project: 9381
Buggy source:
@Override public Map<OWLObjectProperty,OWLClassExpression> getObjectPropertyDomains(){
  Map<OWLObjectProperty,OWLClassExpression> result=new HashMap<>();
  String query=SPARQLQueryUtils.PREFIXES + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  while (rs.hasNext()) {
    QuerySolution qs=rs.next();
    OWLObjectProperty op=df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI()));
    OWLClassExpression domain=df.getOWLClass(IRI.create(qs.getResource("String_Node_Str").getURI()));
    result.put(op,domain);
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<OWLObjectProperty,OWLClassExpression> getObjectPropertyDomains(){
  Map<OWLObjectProperty,OWLClassExpression> result=new HashMap<>();
  String query=SPARQLQueryUtils.PREFIXES + "String_Node_Str";
  ResultSet rs=executeSelectQuery(query);
  while (rs.hasNext()) {
    QuerySolution qs=rs.next();
    OWLObjectProperty op=df.getOWLObjectProperty(IRI.create(qs.getResource("String_Node_Str").getURI()));
    OWLClassExpression domain=df.getOWLThing();
    if (qs.get("String_Node_Str") != null) {
      domain=df.getOWLClass(IRI.create(qs.getResource("String_Node_Str").getURI()));
    }
    result.put(op,domain);
  }
  return result;
}
Program: 9382
Project: 9382
Buggy source:
@Override public SortedSet<OWLClassExpression> getSuperClassesImpl(OWLClassExpression description){
  if (description.isAnonymous()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String query=String.format(SPARQLQueryUtils.SELECT_DIRECT_SUPERCLASS_OF_QUERY,description.asOWLClass().toStringID());
  ResultSet rs=executeSelectQuery(query);
  SortedSet<OWLClass> superClasses=asOWLEntities(EntityType.CLASS,rs,"String_Node_Str");
  superClasses.remove(description);
  return new TreeSet<OWLClassExpression>(superClasses);
}

Fixed version (ground truth):
@Override public SortedSet<OWLClassExpression> getSuperClassesImpl(OWLClassExpression description){
  String query;
  if (description.isAnonymous()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (description.isOWLThing()) {
    return ImmutableSortedSet.of();
  }
 else   if (description.isOWLNothing()) {
    query=String.format(SPARQLQueryUtils.SELECT_LEAF_CLASSES_OWL,description.asOWLClass().toStringID());
  }
 else {
    query=String.format(SPARQLQueryUtils.SELECT_DIRECT_SUPERCLASS_OF_QUERY,description.asOWLClass().toStringID());
  }
  ResultSet rs=executeSelectQuery(query);
  SortedSet<OWLClass> superClasses=asOWLEntities(EntityType.CLASS,rs,"String_Node_Str");
  superClasses.remove(description);
  return new TreeSet<OWLClassExpression>(superClasses);
}
Program: 9383
Project: 9383
Buggy source:
private double precision(String referenceSparqlQuery,String learnedSPARQLQuery){
  List<String> referenceResources=getResult(referenceSparqlQuery);
  if (referenceResources.isEmpty()) {
    logger.error("String_Node_Str" + referenceSparqlQuery);
    return 0;
  }
  if (learnedSPARQLQuery.equals(QueryTreeUtils.EMPTY_QUERY_TREE_QUERY)) {
    return referenceResources.size() / (double)kbSize;
  }
  List<String> learnedResources=getResult(learnedSPARQLQuery);
  if (learnedResources.isEmpty()) {
    logger.error("String_Node_Str" + learnedSPARQLQuery);
    System.err.println(learnedSPARQLQuery);
    return 0;
  }
  int overlap=Sets.intersection(Sets.newHashSet(referenceResources),Sets.newHashSet(learnedResources)).size();
  double precision=overlap / (double)learnedResources.size();
  return precision;
}

Fixed version (ground truth):
private double precision(String referenceSparqlQuery,String learnedSPARQLQuery){
  List<String> referenceResources=getResult(referenceSparqlQuery);
  if (referenceResources.isEmpty()) {
    logger.error("String_Node_Str" + referenceSparqlQuery);
    return 0;
  }
  if (learnedSPARQLQuery.equals(QueryTreeUtils.EMPTY_QUERY_TREE_QUERY)) {
    return referenceResources.size() / (double)kbSize;
  }
  List<String> learnedResources=splitComplexQueries ? getResultSplitted(learnedSPARQLQuery) : getResult(learnedSPARQLQuery);
  if (learnedResources.isEmpty()) {
    logger.error("String_Node_Str" + learnedSPARQLQuery);
    System.err.println(learnedSPARQLQuery);
    return 0;
  }
  int overlap=Sets.intersection(Sets.newHashSet(referenceResources),Sets.newHashSet(learnedResources)).size();
  double precision=overlap / (double)learnedResources.size();
  return precision;
}
Program: 9384
Project: 9384
Buggy source:
private double recall(String referenceSparqlQuery,String learnedSPARQLQuery){
  if (learnedSPARQLQuery.equals(QueryTreeUtils.EMPTY_QUERY_TREE_QUERY)) {
    return 1.0;
  }
  List<String> referenceResources=getResult(referenceSparqlQuery);
  if (referenceResources.isEmpty()) {
    return 0;
  }
  List<String> learnedResources=getResult(learnedSPARQLQuery);
  if (learnedResources.isEmpty()) {
    return 0;
  }
  int overlap=Sets.intersection(Sets.newHashSet(referenceResources),Sets.newHashSet(learnedResources)).size();
  double recall=overlap / (double)referenceResources.size();
  return recall;
}

Fixed version (ground truth):
private double recall(String referenceSparqlQuery,String learnedSPARQLQuery){
  if (learnedSPARQLQuery.equals(QueryTreeUtils.EMPTY_QUERY_TREE_QUERY)) {
    return 1.0;
  }
  List<String> referenceResources=getResult(referenceSparqlQuery);
  if (referenceResources.isEmpty()) {
    return 0;
  }
  List<String> learnedResources=splitComplexQueries ? getResultSplitted(learnedSPARQLQuery) : getResult(learnedSPARQLQuery);
  if (learnedResources.isEmpty()) {
    return 0;
  }
  int overlap=Sets.intersection(Sets.newHashSet(referenceResources),Sets.newHashSet(learnedResources)).size();
  double recall=overlap / (double)referenceResources.size();
  return recall;
}
Program: 9385
Project: 9385
Buggy source:
private List<String> getResult(String sparqlQuery){
  if (splitComplexQueries) {
    return getResultSplitted(sparqlQuery);
  }
  logger.trace(sparqlQuery);
  List<String> resources=cache.get(sparqlQuery);
  if (resources == null) {
    resources=new ArrayList<String>();
    Query query=QueryFactory.create(sparqlQuery);
    String projectVar=query.getProjectVars().get(0).getName();
    ResultSet rs=qef.createQueryExecution(sparqlQuery).execSelect();
    QuerySolution qs;
    while (rs.hasNext()) {
      qs=rs.next();
      if (qs.get(projectVar).isURIResource()) {
        resources.add(qs.getResource(projectVar).getURI());
      }
 else       if (qs.get(projectVar).isLiteral()) {
        resources.add(qs.getLiteral(projectVar).toString());
      }
    }
    cache.put(sparqlQuery,resources);
  }
  return resources;
}

Fixed version (ground truth):
private List<String> getResult(String sparqlQuery){
  logger.trace(sparqlQuery);
  List<String> resources=cache.get(sparqlQuery);
  if (resources == null) {
    resources=new ArrayList<String>();
    Query query=QueryFactory.create(sparqlQuery);
    String projectVar=query.getProjectVars().get(0).getName();
    ResultSet rs=qef.createQueryExecution(sparqlQuery).execSelect();
    QuerySolution qs;
    while (rs.hasNext()) {
      qs=rs.next();
      if (qs.get(projectVar).isURIResource()) {
        resources.add(qs.getResource(projectVar).getURI());
      }
 else       if (qs.get(projectVar).isLiteral()) {
        resources.add(qs.getLiteral(projectVar).toString());
      }
    }
    cache.put(sparqlQuery,resources);
  }
  return resources;
}
Program: 9386
Project: 9386
Buggy source:
@Override public final SortedSet<OWLClassExpression> getSuperClasses(OWLClassExpression concept){
  if (precomputeClassHierarchy) {
    return getClassHierarchy().getSuperClasses(concept);
  }
 else {
    try {
      return getSuperClassesImpl(concept);
    }
 catch (    ReasoningMethodUnsupportedException e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public final SortedSet<OWLClassExpression> getSuperClasses(OWLClassExpression concept){
  if (precomputeClassHierarchy) {
    return getClassHierarchy().getSuperClasses(concept,true);
  }
 else {
    try {
      return getSuperClassesImpl(concept);
    }
 catch (    ReasoningMethodUnsupportedException e) {
      e.printStackTrace();
    }
  }
  return null;
}