nus-yam/ex-repair huggingface dataset:
Program: 9493
Project: 9493
Buggy source:
/** 
 * Precompute the whole index, i.e. iterate over all entities and compute all annotated documents.
 */
public void buildIndex(Set<TextDocument> documents){
  for (  TextDocument document : documents) {
    AnnotatedDocument annotatedDocument=semanticAnnotator.processDocument(document);
    for (    Entity entity : annotatedDocument.getContainedEntities()) {
      Set<AnnotatedDocument> existingAnnotatedDocuments=index.get(entity);
      if (existingAnnotatedDocuments == null) {
        existingAnnotatedDocuments=new HashSet<AnnotatedDocument>();
        index.put(entity,existingAnnotatedDocuments);
      }
      existingAnnotatedDocuments.add(annotatedDocument);
    }
  }
}

Fixed version (ground truth):
public void buildIndex(OWLAnnotationProperty annotationProperty,String language){
  Set<OWLEntity> schemaEntities=new HashSet<OWLEntity>();
  schemaEntities.addAll(ontology.getClassesInSignature());
  schemaEntities.addAll(ontology.getObjectPropertiesInSignature());
  schemaEntities.addAll(ontology.getDataPropertiesInSignature());
  Set<TextDocument> documents=new HashSet<TextDocument>();
  for (  OWLEntity entity : schemaEntities) {
    String label=null;
    Set<OWLAnnotation> annotations=entity.getAnnotations(ontology,annotationProperty);
    for (    OWLAnnotation annotation : annotations) {
      if (annotation.getValue() instanceof OWLLiteral) {
        OWLLiteral val=(OWLLiteral)annotation.getValue();
        if (language != null) {
          if (val.hasLang(language)) {
            label=val.getLiteral();
          }
        }
 else {
          label=val.getLiteral();
        }
      }
    }
    if (label != null) {
      documents.add(new TextDocument(label));
    }
  }
  buildIndex(documents);
}
Program: 9494
Project: 9494
Buggy source:
/** 
 * Computes F-beta-Score.
 * @param recall Recall.
 * @param precision Precision.
 * @param beta Weights precision and recall. If beta is >1, then recall is more importantthan precision.
 * @return Harmonic mean of precision and recall weighted by beta.
 */
public static double getFScore(double recall,double precision,double beta){
  return (precision + recall == 0) ? 0 : ((1 + Math.sqrt(beta)) * (precision * recall) / (Math.sqrt(beta) * precision + recall));
}

Fixed version (ground truth):
/** 
 * Computes F-beta-Score.
 * @param recall Recall.
 * @param precision Precision.
 * @param beta Weights precision and recall. If beta is >1, then recall is more importantthan precision.
 * @return Harmonic mean of precision and recall weighted by beta.
 */
public static double getFScore(double recall,double precision,double beta){
  return (precision + recall == 0) ? 0 : ((1 + beta * beta) * (precision * recall) / (beta * beta * precision + recall));
}
Program: 9495
Project: 9495
Buggy source:
public OWLAxiom rename(OWLAxiom axiom){
  Map<OWLEntity,OWLEntity> renaming=new HashMap<OWLEntity,OWLEntity>();
  renamer=new OWLClassExpressionRenamer(df,renaming);
  axiom.accept(this);
  return renamedAxiom;
}

Fixed version (ground truth):
public OWLAxiom rename(OWLAxiom axiom){
  Map<OWLEntity,OWLEntity> renaming=new HashMap<OWLEntity,OWLEntity>();
  expressionRenamer=new OWLClassExpressionRenamer(df,renaming);
  axiom.accept(this);
  return renamedAxiom;
}
Program: 9496
Project: 9496
Buggy source:
public static void main(String[] args) throws Exception {
  org.apache.log4j.Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout()));
  org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO);
  org.apache.log4j.Logger.getLogger(DataPropertyDomainAxiomLearner.class).setLevel(Level.INFO);
  SparqlEndpointKS ks=new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpediaLiveAKSW());
  SPARQLReasoner reasoner=new SPARQLReasoner(ks);
  reasoner.prepareSubsumptionHierarchy();
  ObjectPropertyDomainAxiomLearner l=new ObjectPropertyDomainAxiomLearner(ks);
  l.setReasoner(reasoner);
  l.setPropertyToDescribe(new ObjectProperty("String_Node_Str"));
  l.setMaxExecutionTimeInSeconds(40);
  l.init();
  l.start();
  System.out.println(l.getCurrentlyBestEvaluatedAxioms());
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  org.apache.log4j.Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout()));
  org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO);
  org.apache.log4j.Logger.getLogger(DataPropertyDomainAxiomLearner.class).setLevel(Level.INFO);
  SparqlEndpointKS ks=new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpedia());
  SPARQLReasoner reasoner=new SPARQLReasoner(ks);
  reasoner.prepareSubsumptionHierarchy();
  ObjectPropertyDomainAxiomLearner l=new ObjectPropertyDomainAxiomLearner(ks);
  l.setReasoner(reasoner);
  l.setPropertyToDescribe(new ObjectProperty("String_Node_Str"));
  l.setMaxExecutionTimeInSeconds(10);
  l.setForceSPARQL_1_0_Mode(true);
  l.init();
  l.start();
  System.out.println(l.getCurrentlyBestEvaluatedAxioms(0.7));
}
Program: 9497
Project: 9497
Buggy source:
private Iterator<Triple> execTriples(){
  HttpQuery httpQuery=makeHttpQuery();
  httpQuery.setAccept(modelContentType);
  InputStream in=httpQuery.exec();
  String actualContentType=httpQuery.getContentType();
  if (actualContentType == null || actualContentType.equals("String_Node_Str")) {
    actualContentType=modelContentType;
  }
  Lang lang=WebContent.contentTypeToLang(actualContentType);
  if (!lang.isTriples())   throw new QueryException("String_Node_Str" + actualContentType + "String_Node_Str");
  return RiotReader.createIteratorTriples(in,lang,null);
}

Fixed version (ground truth):
private Iterator<Triple> execTriples(){
  HttpQuery httpQuery=makeHttpQuery();
  httpQuery.setAccept(modelContentType);
  InputStream in=httpQuery.exec();
  String actualContentType=httpQuery.getContentType();
  if (actualContentType == null || actualContentType.equals("String_Node_Str")) {
    actualContentType=modelContentType;
  }
  Lang lang=WebContent.contentTypeToLang(actualContentType);
  if (!RDFLanguages.isTriples(lang))   throw new QueryException("String_Node_Str" + actualContentType + "String_Node_Str");
  return RiotReader.createIteratorTriples(in,lang,null);
}
Program: 9498
Project: 9498
Buggy source:
private Model execModel(Model model){
  HttpQuery httpQuery=makeHttpQuery();
  httpQuery.setAccept(WebContent.contentTypeNTriples);
  InputStream in=httpQuery.exec();
  String actualContentType=httpQuery.getContentType();
  if (actualContentType == null || actualContentType.equals("String_Node_Str")) {
    actualContentType=modelContentType;
  }
  Lang lang=WebContent.contentTypeToLang(actualContentType);
  if (!lang.isTriples())   throw new QueryException("String_Node_Str" + actualContentType + "String_Node_Str");
  model.read(in,null,"String_Node_Str");
  return model;
}

Fixed version (ground truth):
private Model execModel(Model model){
  HttpQuery httpQuery=makeHttpQuery();
  httpQuery.setAccept(WebContent.contentTypeNTriplesAlt);
  InputStream in=httpQuery.exec();
  String actualContentType=httpQuery.getContentType();
  if (actualContentType == null || actualContentType.equals("String_Node_Str")) {
    actualContentType=modelContentType;
  }
  Lang lang=WebContent.contentTypeToLang(actualContentType);
  if (!RDFLanguages.isTriples(lang))   throw new QueryException("String_Node_Str" + actualContentType + "String_Node_Str");
  model.read(in,null,"String_Node_Str");
  return model;
}
Program: 9499
Project: 9499
Buggy source:
/** 
 * Sets the Content Type for CONSTRUCT/DESCRIBE queries provided that the format is supported
 * @param contentType
 */
public void setModelContentType(String contentType){
  Lang lang=WebContent.contentTypeToLang(contentType);
  if (lang == null)   throw new IllegalArgumentException("String_Node_Str" + contentType + "String_Node_Str");
  if (!lang.isTriples())   throw new IllegalArgumentException("String_Node_Str" + contentType + "String_Node_Str");
  modelContentType=contentType;
}

Fixed version (ground truth):
/** 
 * Sets the Content Type for CONSTRUCT/DESCRIBE queries provided that the format is supported
 * @param contentType
 */
public void setModelContentType(String contentType){
  Lang lang=WebContent.contentTypeToLang(contentType);
  if (lang == null)   throw new IllegalArgumentException("String_Node_Str" + contentType + "String_Node_Str");
  if (!RDFLanguages.isTriples(lang))   throw new IllegalArgumentException("String_Node_Str" + contentType + "String_Node_Str");
  modelContentType=contentType;
}
Program: 9501
Project: 9501
Buggy source:
public int compare(OWLNamedObject o1,OWLNamedObject o2){
  return o1.getIRI().compareTo(o2.getIRI());
}

Fixed version (ground truth):
public int compare(OWLNamedObject o1,OWLNamedObject o2){
  return o1.compareTo(o2);
}
Program: 9502
Project: 9502
Buggy source:
public SortedSet<Individual> getIndividuals(Description description,int limit){
  if (!(description instanceof NamedClass)) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  SortedSet<Individual> individuals=new TreeSet<Individual>();
  String query=String.format("String_Node_Str",((NamedClass)description).getName());
  if (limit != 0) {
    query+="String_Node_Str" + limit;
  }
  ResultSet rs=executeSelectQuery(query);
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    individuals.add(new Individual(qs.getResource("String_Node_Str").getURI()));
  }
  return individuals;
}

Fixed version (ground truth):
public SortedSet<Individual> getIndividuals(Description description,int limit){
  if (!(description instanceof NamedClass)) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  SortedSet<Individual> individuals=new TreeSet<Individual>();
  String query=String.format("String_Node_Str",((NamedClass)description).getName());
  if (limit != 0) {
    query+="String_Node_Str" + limit;
  }
  System.out.println(query);
  ResultSet rs=executeSelectQuery(query);
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    if (qs.get("String_Node_Str").isURIResource()) {
      individuals.add(new Individual(qs.getResource("String_Node_Str").getURI()));
    }
  }
  return individuals;
}
Program: 9504
Project: 9504
Buggy source:
private List<EvaluatedAxiom> buildAxioms(Map<ObjectProperty,Integer> property2Count){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Integer all=property2Count.get(propertyToDescribe);
  property2Count.remove(propertyToDescribe);
  EvaluatedAxiom evalAxiom;
  Set<ObjectProperty> properties;
  for (  Entry<ObjectProperty,Integer> entry : sortByValues(property2Count)) {
    properties=new HashSet<ObjectProperty>();
    properties.add(propertyToDescribe);
    properties.add(entry.getKey());
    int popularity=reasoner.getPropertyCount(entry.getKey());
    int total=Math.max(popularity,all);
    int success=entry.getValue();
    Score score=computeScore(total,success);
    evalAxiom=new EvaluatedAxiom(new EquivalentObjectPropertiesAxiom(properties),score);
    axioms.add(evalAxiom);
  }
  property2Count.put(propertyToDescribe,all);
  return axioms;
}

Fixed version (ground truth):
private List<EvaluatedAxiom> buildAxioms(Map<ObjectProperty,Integer> property2Count){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Integer all=property2Count.get(propertyToDescribe);
  property2Count.remove(propertyToDescribe);
  EvaluatedAxiom evalAxiom;
  List<ObjectProperty> properties;
  for (  Entry<ObjectProperty,Integer> entry : sortByValues(property2Count)) {
    properties=new ArrayList<ObjectProperty>();
    properties.add(propertyToDescribe);
    properties.add(entry.getKey());
    int popularity=reasoner.getPropertyCount(entry.getKey());
    int total=Math.max(popularity,all);
    int success=entry.getValue();
    Score score=computeScore(total,success);
    evalAxiom=new EvaluatedAxiom(new EquivalentObjectPropertiesAxiom(properties),score);
    axioms.add(evalAxiom);
  }
  property2Count.put(propertyToDescribe,all);
  return axioms;
}
Program: 9505
Project: 9505
Buggy source:
public EquivalentObjectPropertiesAxiom(Set<ObjectProperty> equivalentProperties){
  this.equivalentProperties=equivalentProperties;
}

Fixed version (ground truth):
public EquivalentObjectPropertiesAxiom(Collection<ObjectProperty> equivalentProperties){
  this.equivalentProperties=equivalentProperties;
}
Program: 9506
Project: 9506
Buggy source:
public Set<ObjectProperty> getEquivalentProperties(){
  return equivalentProperties;
}

Fixed version (ground truth):
public Collection<ObjectProperty> getEquivalentProperties(){
  return equivalentProperties;
}
Program: 9507
Project: 9507
Buggy source:
public SPARQLReasoner(OntModel model){
  this.model=model;
  classPopularityMap=new HashMap<NamedClass,Integer>();
}

Fixed version (ground truth):
public SPARQLReasoner(OntModel model){
  this.model=model;
  classPopularityMap=new HashMap<NamedClass,Integer>();
  objectPropertyPopularityMap=new HashMap<ObjectProperty,Integer>();
}
Program: 9508
Project: 9508
Buggy source:
protected Score computeScore(int total,int success){
  double[] confidenceInterval=Heuristics.getConfidenceInterval95Wald(total,success);
  double accuracy=(confidenceInterval[0] + confidenceInterval[1]) / 2;
  double confidence=confidenceInterval[1] - confidenceInterval[0];
  return new AxiomScore(accuracy,confidence);
}

Fixed version (ground truth):
protected Score computeScore(int total,int success){
  double[] confidenceInterval=Heuristics.getConfidenceInterval95Wald(total,success);
  double accuracy=(confidenceInterval[0] + confidenceInterval[1]) / 2;
  double confidence=confidenceInterval[1] - confidenceInterval[0];
  return new AxiomScore(accuracy,confidence,total,success,total - success);
}
Program: 9509
Project: 9509
Buggy source:
public AxiomScore(double accuracy,double confidence){
  this.accuracy=accuracy;
}

Fixed version (ground truth):
public AxiomScore(double accuracy,double confidence,int totalNrOfExamples,int nrOfpositiveExamples,int nrOfnegativeExamples){
  this.accuracy=accuracy;
  this.confidence=confidence;
  this.totalNrOfExamples=totalNrOfExamples;
  this.nrOfpositiveExamples=nrOfpositiveExamples;
  this.nrOfnegativeExamples=nrOfnegativeExamples;
}
Program: 9510
Project: 9510
Buggy source:
public OWLOntology createOWLOntology(OWLOntologyManager manager){
  JenaToOwlapiConverter converter=new JenaToOwlapiConverter();
  return converter.convert(this.model,manager);
}

Fixed version (ground truth):
@Override public OWLOntology createOWLOntology(OWLOntologyManager manager){
  JenaToOwlapiConverter converter=new JenaToOwlapiConverter();
  return converter.convert(this.model,manager);
}
Program: 9512
Project: 9512
Buggy source:
public static void main(String[] args) throws Exception {
  org.apache.log4j.Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout()));
  org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO);
  org.apache.log4j.Logger.getLogger(DataPropertyDomainAxiomLearner.class).setLevel(Level.INFO);
  SparqlEndpointKS ks=new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpediaLiveAKSW());
  SPARQLReasoner reasoner=new SPARQLReasoner(ks);
  reasoner.prepareSubsumptionHierarchy();
  ObjectPropertyDomainAxiomLearner l=new ObjectPropertyDomainAxiomLearner(ks);
  l.setReasoner(reasoner);
  l.setPropertyToDescribe(new ObjectProperty("String_Node_Str"));
  l.setMaxExecutionTimeInSeconds(10);
  l.addFilterNamespace("String_Node_Str");
  l.init();
  l.start();
  System.out.println(l.getCurrentlyBestEvaluatedAxioms(10,0.75));
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  org.apache.log4j.Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout()));
  org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO);
  org.apache.log4j.Logger.getLogger(DataPropertyDomainAxiomLearner.class).setLevel(Level.INFO);
  SparqlEndpointKS ks=new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpediaLiveAKSW());
  SPARQLReasoner reasoner=new SPARQLReasoner(ks);
  reasoner.prepareSubsumptionHierarchy();
  ObjectPropertyDomainAxiomLearner l=new ObjectPropertyDomainAxiomLearner(ks);
  l.setReasoner(reasoner);
  l.setPropertyToDescribe(new ObjectProperty("String_Node_Str"));
  l.setMaxExecutionTimeInSeconds(40);
  l.addFilterNamespace("String_Node_Str");
  l.init();
  l.start();
  System.out.println(l.getCurrentlyBestEvaluatedAxioms(10,0.3));
}
Program: 9513
Project: 9513
Buggy source:
public ObjectPropertyRangeAxiomLearner(SparqlEndpointKS ks){
  this.ks=ks;
}

Fixed version (ground truth):
public ObjectPropertyRangeAxiomLearner(SparqlEndpointKS ks){
  this.ks=ks;
  super.iterativeQueryTemplate=new ParameterizedSparqlString("String_Node_Str");
}
Program: 9515
Project: 9515
Buggy source:
public Set<String> difference(Set<String> alreadyQueriedIndividuals,OntModel model){
  Set<String> candidates=new HashSet<String>();
  Set<String> result=new HashSet<String>();
  for (ResIterator it=model.listSubjects(); it.hasNext(); ) {
    candidates.add(it.next().getURI());
  }
  for (NodeIterator it=model.listObjects(); it.hasNext(); ) {
    RDFNode cur=it.next();
    if (cur.isURIResource() && !cur.isAnon()) {
      candidates.add(((Resource)cur).getURI());
    }
  }
  for (  String candidate : candidates) {
    if (!alreadyQueriedIndividuals.contains(candidate)) {
      System.out.println(candidate);
      result.add(candidate);
    }
  }
  return result;
}

Fixed version (ground truth):
public Set<String> difference(Set<String> alreadyQueriedIndividuals,OntModel model){
  Set<String> candidates=new HashSet<String>();
  Set<String> result=new HashSet<String>();
  for (ResIterator it=model.listSubjects(); it.hasNext(); ) {
    candidates.add(it.next().getURI());
  }
  for (NodeIterator it=model.listObjects(); it.hasNext(); ) {
    RDFNode cur=it.next();
    if (cur.isURIResource() && !cur.isAnon()) {
      candidates.add(((Resource)cur).getURI());
    }
  }
  for (  String candidate : candidates) {
    if (!alreadyQueriedIndividuals.contains(candidate)) {
      result.add(candidate);
    }
  }
  return result;
}
Program: 9516
Project: 9516
Buggy source:
private void createElementsOfResources(ArrayList<ArrayList<Hypothesis>> hypothesenList,ArrayList<ArrayList<String>> conditionList) throws IOException {
  for (  ArrayList<Hypothesis> hl : hypothesenList) {
    for (    Hypothesis h : hl) {
      if (h.getType().contains("String_Node_Str") && h.getUri().contains("String_Node_Str")) {
        for (        ArrayList<String> cl : conditionList) {
          if (h.getVariable().equals(cl.get(0))) {
            ElementList el=new ElementList(h.getName() + "String_Node_Str",h.getUri(),ServerUtil.getPropertiesForGivenResource(h.getUri(),"String_Node_Str"));
            this.addElements(el);
          }
          if (h.getVariable().equals(cl.get(2))) {
            ElementList el_left=new ElementList(h.getName() + "String_Node_Str",h.getUri(),ServerUtil.getPropertiesForGivenResource(h.getUri(),"String_Node_Str"));
            this.addElements(el_left);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void createElementsOfResources(ArrayList<ArrayList<Hypothesis>> hypothesenList,ArrayList<ArrayList<String>> conditionList) throws IOException {
  for (  ArrayList<Hypothesis> hl : hypothesenList) {
    for (    Hypothesis h : hl) {
      if (h.getType().contains("String_Node_Str") && h.getUri().contains("String_Node_Str")) {
        System.out.println("String_Node_Str" + h.getName() + "String_Node_Str"+ h.getUri());
        for (        ArrayList<String> cl : conditionList) {
          if (h.getVariable().equals(cl.get(0))) {
            ElementList el=new ElementList(h.getName() + "String_Node_Str",h.getUri(),ServerUtil.getPropertiesForGivenResource(h.getUri(),"String_Node_Str"));
            this.addElements(el);
          }
          if (h.getVariable().equals(cl.get(2))) {
            ElementList el_left=new ElementList(h.getName() + "String_Node_Str",h.getUri(),ServerUtil.getPropertiesForGivenResource(h.getUri(),"String_Node_Str"));
            this.addElements(el_left);
          }
        }
      }
    }
  }
}
Program: 9517
Project: 9517
Buggy source:
private void createElementsOfClasses(ArrayList<ArrayList<Hypothesis>> hypothesenList) throws IOException {
  for (  ArrayList<Hypothesis> hl : hypothesenList) {
    for (    Hypothesis h : hl) {
      if (h.getType().contains("String_Node_Str") && h.getUri().contains("String_Node_Str")) {
        ElementList el=new ElementList(h.getName(),h.getUri(),ServerUtil.getElementsForGivenClass(h.getUri()));
        this.addElements(el);
      }
    }
  }
}

Fixed version (ground truth):
private void createElementsOfClasses(ArrayList<ArrayList<Hypothesis>> hypothesenList) throws IOException {
  for (  ArrayList<Hypothesis> hl : hypothesenList) {
    for (    Hypothesis h : hl) {
      if (h.getType().contains("String_Node_Str") && h.getUri().contains("String_Node_Str")) {
        System.out.println("String_Node_Str" + h.getName() + "String_Node_Str"+ h.getUri());
        ElementList el=new ElementList(h.getName(),h.getUri(),ServerUtil.getElementsForGivenClass(h.getUri()));
        this.addElements(el);
      }
    }
  }
}
Program: 9519
Project: 9519
Buggy source:
public static double nld(String orig,String eing){
  double result=computeLevenshteinDistance(orig,eing);
  double length=Math.max(orig.length(),eing.length());
  if (result == 0.0) {
    return 1.0;
  }
 else {
    double result_nld=result / length;
    return result_nld;
  }
}

Fixed version (ground truth):
public static double nld(String orig,String eing){
  double result=computeLevenshteinDistance(orig,eing);
  double length=Math.max(orig.length(),eing.length());
  if (result == 0.0) {
    return 1.0;
  }
 else {
    double result_nld=result / length;
    double result1=1 - result_nld;
    return result1;
  }
}
Program: 9520
Project: 9520
Buggy source:
public static void doSort(ArrayList<QueryPair> qp){
  boolean change=true;
  while (change) {
    change=false;
    for (int i=0; i < qp.size() - 1; i++) {
      if (qp.get(i).getRank() < qp.get(i + 1).getRank()) {
        change=true;
        QueryPair one=qp.get(i);
        QueryPair two=qp.get(i + 1);
        qp.set(i,two);
        qp.set(i + 1,one);
      }
    }
  }
  for (  QueryPair p : qp) {
    p.printAll();
  }
}

Fixed version (ground truth):
public static void doSort(ArrayList<QueryPair> qp){
  boolean change=true;
  while (change) {
    change=false;
    for (int i=0; i < qp.size() - 1; i++) {
      if (qp.get(i).getRank() < qp.get(i + 1).getRank()) {
        change=true;
        QueryPair one=qp.get(i);
        QueryPair two=qp.get(i + 1);
        qp.set(i,two);
        qp.set(i + 1,one);
      }
    }
  }
}
Program: 9522
Project: 9522
Buggy source:
private static String getListOfElements(String verarbeitungsurl){
  String result="String_Node_Str";
  HttpURLConnection connection=null;
  BufferedReader rd=null;
  StringBuilder sb=null;
  String line=null;
  URL serverAddress=null;
  try {
    serverAddress=new URL(verarbeitungsurl);
    connection=null;
    connection=(HttpURLConnection)serverAddress.openConnection();
    connection.setRequestMethod("String_Node_Str");
    connection.setDoOutput(true);
    connection.setReadTimeout(getTimeToTimeoutOnServer());
    connection.connect();
    rd=new BufferedReader(new InputStreamReader(connection.getInputStream()));
    sb=new StringBuilder();
    while ((line=rd.readLine()) != null) {
      sb.append(line + '\n');
    }
    result=sb.toString();
  }
 catch (  MalformedURLException e) {
    System.out.println("String_Node_Str");
  }
catch (  IOException e) {
    System.out.println("String_Node_Str");
  }
 finally {
    connection.disconnect();
    rd=null;
    sb=null;
    connection=null;
  }
  return result;
}

Fixed version (ground truth):
private static String getListOfElements(String verarbeitungsurl){
  String result="String_Node_Str";
  HttpURLConnection connection=null;
  BufferedReader rd=null;
  StringBuilder sb=null;
  String line=null;
  URL serverAddress=null;
  try {
    serverAddress=new URL(verarbeitungsurl);
    connection=null;
    connection=(HttpURLConnection)serverAddress.openConnection();
    connection.setRequestMethod("String_Node_Str");
    connection.setDoOutput(true);
    connection.setReadTimeout(getTimeToTimeoutOnServer());
    connection.connect();
    rd=new BufferedReader(new InputStreamReader(connection.getInputStream()));
    sb=new StringBuilder();
    while ((line=rd.readLine()) != null) {
      sb.append(line + '\n');
    }
    result=sb.toString();
  }
 catch (  MalformedURLException e) {
    System.err.println("String_Node_Str" + verarbeitungsurl + "String_Node_Str");
  }
catch (  IOException e) {
    System.err.println("String_Node_Str");
  }
 finally {
    try {
      connection.disconnect();
    }
 catch (    Exception e) {
      System.err.println("String_Node_Str");
    }
    rd=null;
    sb=null;
    connection=null;
  }
  return result;
}
Program: 9523
Project: 9523
Buggy source:
/** 
 * Uses an URI of a Class to get the Elements of the Class and the related URIs
 * @param classUri
 * @return
 * @throws IOException
 */
public static HashMap<String,String> getElementsForGivenClass(String classUri) throws IOException {
  String query="String_Node_Str" + classUri + "String_Node_Str";
  String result="String_Node_Str";
  result=getListOfElements(query);
  return generateList(result);
}

Fixed version (ground truth):
/** 
 * Uses an URI of a Class to get the Elements of the Class and the related URIs
 * @param classUri
 * @return
 * @throws IOException
 */
public static HashMap<String,String> getElementsForGivenClass(String classUri) throws IOException {
  String query="String_Node_Str" + classUri + "String_Node_Str";
  String query_final=ServerUtil.getServer_Prefix() + "String_Node_Str" + ServerUtil.createServerRequest(query)+ "String_Node_Str";
  String result="String_Node_Str";
  result=getListOfElements(query_final);
  return generateList(result);
}
Program: 9524
Project: 9524
Buggy source:
public static ArrayList<String> searchIndexForProperty(String string,SQLiteIndex myindex) throws SQLException {
  HashMap<String,Float> hm=new HashMap<String,Float>();
  string=string.replace("String_Node_Str","String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str");
  String result=null;
  ArrayList<String> result_List=new ArrayList<String>();
  result=myindex.getPropertyURI(string.toLowerCase());
  if (result != null) {
    result_List.add(result);
    hm.put(result,1.0f);
  }
 else {
    result_List.add("String_Node_Str" + string.toLowerCase().replace("String_Node_Str","String_Node_Str"));
    hm.put(result,0.0f);
  }
  return result_List;
}

Fixed version (ground truth):
public static ArrayList<String> searchIndexForProperty(String string,SQLiteIndex myindex) throws SQLException {
  HashMap<String,Float> hm=new HashMap<String,Float>();
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str");
  String result=null;
  ArrayList<String> result_List=new ArrayList<String>();
  result=myindex.getPropertyURI(string.toLowerCase());
  System.err.println("String_Node_Str" + result);
  if (result != null) {
    result_List.add(result);
    hm.put(result,1.0f);
    System.err.println("String_Node_Str" + string.toLowerCase());
  }
 else {
    System.err.println("String_Node_Str" + string.toLowerCase());
    result_List.add("String_Node_Str" + string.toLowerCase().replace("String_Node_Str","String_Node_Str"));
    hm.put(result,0.0f);
  }
  System.err.println("String_Node_Str");
  return result_List;
}
Program: 9525
Project: 9525
Buggy source:
public String getPropertyURI(String string) throws SQLException {
  Statement stat=conn.createStatement();
  ResultSet rs;
  try {
    rs=stat.executeQuery("String_Node_Str" + string.toLowerCase() + "String_Node_Str");
    return rs.getString("String_Node_Str");
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
public String getPropertyURI(String string) throws SQLException {
  Statement stat=conn.createStatement();
  ResultSet rs;
  ArrayList<String> al=new ArrayList<String>();
  try {
    rs=stat.executeQuery("String_Node_Str" + string.toLowerCase() + "String_Node_Str");
    while (rs.next()) {
      String result_string=rs.getString("String_Node_Str");
      System.out.println("String_Node_Str" + result_string);
      boolean found=false;
      for (      String s : al) {
        if (s.equals(result_string))         found=true;
      }
      if (found == false)       al.add(result_string);
    }
    rs=stat.executeQuery("String_Node_Str" + string.toLowerCase() + "String_Node_Str");
    while (rs.next()) {
      String result_string=rs.getString("String_Node_Str");
      System.out.println("String_Node_Str" + result_string);
      boolean found=false;
      for (      String s : al) {
        if (s.equals(result_string))         found=true;
      }
      if (found == false)       al.add(result_string);
    }
    System.out.println("String_Node_Str" + al.size());
    if (al.size() == 1)     return al.get(0);
 else {
      boolean found=false;
      for (      String s : al) {
        if (s.contains("String_Node_Str")) {
          System.out.println("String_Node_Str" + s);
          found=true;
          return s;
        }
      }
      if (found == false) {
        System.out.println("String_Node_Str" + al.get(0));
        return al.get(0);
      }
    }
    return null;
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
    return null;
  }
}
Program: 9527
Project: 9527
Buggy source:
private static ArrayList<String> createAnswerArray(String string){
  Pattern p=Pattern.compile("String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  Matcher m=p.matcher(string);
  String[] bla=string.split("String_Node_Str");
  ArrayList<String> result=new ArrayList<String>();
  for (  String s : bla) {
    m=p.matcher(s);
    while (m.find()) {
      String temp=m.group(1);
      temp=temp.replace("String_Node_Str","String_Node_Str");
      temp=temp.replace("String_Node_Str","String_Node_Str");
      result.add(temp);
    }
  }
  if (string.matches("String_Node_Str") || string.matches("String_Node_Str"))   result.add(string);
  return result;
}

Fixed version (ground truth):
private static ArrayList<String> createAnswerArray(String string){
  Pattern p=Pattern.compile("String_Node_Str");
  string=string.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  Matcher m=p.matcher(string);
  String[] bla=string.split("String_Node_Str");
  ArrayList<String> result=new ArrayList<String>();
  for (  String s : bla) {
    m=p.matcher(s);
    while (m.find()) {
      String temp=m.group(1);
      temp=temp.replace("String_Node_Str","String_Node_Str");
      temp=temp.replace("String_Node_Str","String_Node_Str");
      temp=temp.replace("String_Node_Str","String_Node_Str");
      temp=temp.replace("String_Node_Str","String_Node_Str");
      temp=temp.replace("String_Node_Str","String_Node_Str");
      temp=temp.replace("String_Node_Str","String_Node_Str");
      result.add(temp);
    }
  }
  if (string.matches("String_Node_Str") || string.matches("String_Node_Str"))   result.add(string);
  return result;
}
Program: 9528
Project: 9528
Buggy source:
private static boolean checkAnswer(String answer){
  if (answer.contains("String_Node_Str") || answer.contains("String_Node_Str") || answer.contains("String_Node_Str")|| answer.contains("String_Node_Str")|| answer.contains("String_Node_Str"))   return false;
 else   return true;
}

Fixed version (ground truth):
private static boolean checkAnswer(String answer){
  if (answer.contains("String_Node_Str") || answer.contains("String_Node_Str") || answer.contains("String_Node_Str")|| answer.contains("String_Node_Str")|| answer.contains("String_Node_Str")|| answer.contains("String_Node_Str"))   return false;
 else   return true;
}
Program: 9532
Project: 9532
Buggy source:
public void printAll(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + condition);
  int anzahl=1;
  for (  ArrayList<Hypothesis> x : hypothesen) {
    System.out.println("String_Node_Str" + anzahl + "String_Node_Str");
    for (    Hypothesis z : x) {
      z.printAll();
    }
  }
  System.out.print("String_Node_Str");
  System.out.println("String_Node_Str" + selectTerm);
  System.out.println("String_Node_Str" + having);
  System.out.println("String_Node_Str" + filter);
  System.out.println("String_Node_Str" + OrderBy);
  System.out.println("String_Node_Str" + limit);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void printAll(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + condition);
  int anzahl=1;
  for (  ArrayList<Hypothesis> x : hypothesen) {
    System.out.println("String_Node_Str" + anzahl + "String_Node_Str");
    anzahl+=1;
    for (    Hypothesis z : x) {
      z.printAll();
    }
  }
  System.out.print("String_Node_Str");
  System.out.println("String_Node_Str" + selectTerm);
  System.out.println("String_Node_Str" + having);
  System.out.println("String_Node_Str" + filter);
  System.out.println("String_Node_Str" + OrderBy);
  System.out.println("String_Node_Str" + limit);
  System.out.println("String_Node_Str");
}
Program: 9534
Project: 9534
Buggy source:
/** 
 * @param args
 * @throws SQLException 
 * @throws ClassNotFoundException 
 * @throws MalformedURLException 
 */
public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, SQLException {
  TemplateBuilder testobject=new TemplateBuilder();
  String question="String_Node_Str";
  testobject.createTemplates(question);
  question="String_Node_Str";
  testobject.createTemplates(question);
  question="String_Node_Str";
  testobject.createTemplates(question);
  question="String_Node_Str";
  testobject.createTemplates(question);
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws SQLException 
 * @throws ClassNotFoundException 
 * @throws IOException 
 */
public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
  ArrayList<Template> temp_list_result=new ArrayList<Template>();
  TemplateBuilder testobject=new TemplateBuilder();
  ArrayList<queryInformation> list_of_structs=new ArrayList<queryInformation>();
  list_of_structs=generateStruct("String_Node_Str");
  System.out.println("String_Node_Str");
  for (  queryInformation s : list_of_structs) {
    System.out.println("String_Node_Str");
    ArrayList<Template> temp_list=new ArrayList<Template>();
    temp_list=testobject.createTemplates(s.getQuery().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
    for (    Template t : temp_list) {
      temp_list_result.add(t);
    }
  }
  String result="String_Node_Str";
  for (  Template t : temp_list_result) {
    result+="String_Node_Str";
    result+="String_Node_Str" + t.getCondition() + "String_Node_Str";
    int anzahl=1;
    for (    ArrayList<Hypothesis> x : t.getHypothesen()) {
      result+="String_Node_Str" + anzahl + "String_Node_Str";
      anzahl+=1;
      for (      Hypothesis z : x) {
        result+="String_Node_Str" + "String_Node_Str";
        result+="String_Node_Str" + z.getVariable() + "String_Node_Str";
        result+="String_Node_Str" + z.getUri() + "String_Node_Str";
        result+="String_Node_Str" + z.getType() + "String_Node_Str";
        result+="String_Node_Str" + z.getRank() + "String_Node_Str";
        result+="String_Node_Str" + "String_Node_Str";
      }
    }
    result+="String_Node_Str";
    result+="String_Node_Str" + t.getSelectTerm() + "String_Node_Str";
    result+="String_Node_Str" + t.getHaving() + "String_Node_Str";
    result+="String_Node_Str" + t.getFilter() + "String_Node_Str";
    result+="String_Node_Str" + t.getOrderBy() + "String_Node_Str";
    result+="String_Node_Str" + t.getLimit() + "String_Node_Str";
    result+="String_Node_Str";
  }
  File file=new File("String_Node_Str");
  BufferedWriter bw=new BufferedWriter(new FileWriter(file));
  bw.write(result);
  bw.flush();
  bw.close();
}
Program: 9535
Project: 9535
Buggy source:
@Override public OWLOntology getCoherentOntology(OWLOntology ontology,boolean preferRoots){
  this.ontology=ontology;
  this.incoherentOntology=getOntologyWithoutAnnotations(ontology);
  File diffFile=new File(new File(ontology.getOWLOntologyManager().getOntologyDocumentIRI(ontology).toURI()).getParent() + "String_Node_Str" + DIFF_ONTOLOGY_NAME);
  try {
    if (diffFile.exists()) {
      diffOntology=manager.loadOntologyFromOntologyDocument(diffFile);
    }
 else {
      diffOntology=manager.createOntology(IRI.create("String_Node_Str"));
    }
  }
 catch (  OWLOntologyCreationException e1) {
    e1.printStackTrace();
  }
  removedTransitiveAxioms=incoherentOntology.getAxioms(AxiomType.TRANSITIVE_OBJECT_PROPERTY);
  incoherentOntology.getOWLOntologyManager().removeAxioms(incoherentOntology,removedTransitiveAxioms);
  manager=incoherentOntology.getOWLOntologyManager();
  factory=manager.getOWLDataFactory();
  long startTime=System.currentTimeMillis();
  reasoner=new IncrementalClassifier(incoherentOntology);
  reasoner.classify();
  logger.info("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  unsatObjectProperties=getUnsatisfiableObjectProperties(reasoner);
  logger.info("String_Node_Str" + unsatObjectProperties.size());
  if (computeParallel) {
    entity2ModuleMap.putAll(extractModules(unsatObjectProperties));
  }
  if (preferRoots) {
    return computeCoherentOntologyRootBased(incoherentOntology);
  }
 else {
    return computeCoherentOntology(incoherentOntology);
  }
}

Fixed version (ground truth):
@Override public OWLOntology getCoherentOntology(OWLOntology ontology,boolean preferRoots){
  this.ontology=ontology;
  this.incoherentOntology=getOntologyWithoutAnnotations(ontology);
  new File("String_Node_Str").mkdir();
  File diffFile=new File("String_Node_Str" + DIFF_ONTOLOGY_NAME);
  try {
    if (diffFile.exists()) {
      diffOntology=manager.loadOntologyFromOntologyDocument(diffFile);
    }
 else {
      diffOntology=manager.createOntology(IRI.create("String_Node_Str"));
    }
  }
 catch (  OWLOntologyCreationException e1) {
    e1.printStackTrace();
  }
  removedTransitiveAxioms=incoherentOntology.getAxioms(AxiomType.TRANSITIVE_OBJECT_PROPERTY);
  incoherentOntology.getOWLOntologyManager().removeAxioms(incoherentOntology,removedTransitiveAxioms);
  manager=incoherentOntology.getOWLOntologyManager();
  factory=manager.getOWLDataFactory();
  long startTime=System.currentTimeMillis();
  reasoner=new IncrementalClassifier(incoherentOntology);
  reasoner.classify();
  logger.info("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  unsatObjectProperties=getUnsatisfiableObjectProperties(reasoner);
  logger.info("String_Node_Str" + unsatObjectProperties.size());
  if (computeParallel) {
    entity2ModuleMap.putAll(extractModules(unsatObjectProperties));
  }
  if (preferRoots) {
    return computeCoherentOntologyRootBased(incoherentOntology);
  }
 else {
    return computeCoherentOntology(incoherentOntology);
  }
}
Program: 9536
Project: 9536
Buggy source:
public static void main(String[] args) throws Exception {
  Logger.getRootLogger().setLevel(Level.INFO);
  Logger.getRootLogger().removeAllAppenders();
  Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout()));
  Logger.getRootLogger().addAppender(new FileAppender(new SimpleLayout(),"String_Node_Str"));
  if (args.length != 3) {
    System.out.println("String_Node_Str");
    System.exit(0);
  }
  String filename=args[0];
  String target=args[1];
  double stepSize=Double.parseDouble(args[2]);
  System.out.println("String_Node_Str");
  InputStream is=new BufferedInputStream(new FileInputStream(filename));
  if (args[0].endsWith("String_Node_Str")) {
    is=new CompressorStreamFactory().createCompressorInputStream("String_Node_Str",is);
  }
  OWLOntologyManager man=OWLManager.createOWLOntologyManager();
  OWLOntology schema=man.loadOntologyFromOntologyDocument(is);
  System.out.println("String_Node_Str");
  GreedyCohaerencyExtractor ge=new GreedyCohaerencyExtractor();
  ge.getCoherentOntology(schema,target,stepSize);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Logger.getRootLogger().setLevel(Level.INFO);
  Logger.getRootLogger().removeAllAppenders();
  Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout()));
  Logger.getRootLogger().addAppender(new FileAppender(new SimpleLayout(),"String_Node_Str"));
  if (args.length != 3) {
    System.out.println("String_Node_Str");
    System.exit(0);
  }
  String filename=args[0];
  String target=args[1];
  double stepSize=Double.parseDouble(args[2]);
  System.out.println("String_Node_Str");
  InputStream is=new BufferedInputStream(new FileInputStream(filename));
  if (args[0].endsWith("String_Node_Str")) {
    is=new CompressorStreamFactory().createCompressorInputStream("String_Node_Str",is);
  }
  OWLOntologyManager man=OWLManager.createOWLOntologyManager();
  OWLOntology schema=man.loadOntologyFromOntologyDocument(is);
  man.removeAxioms(schema,schema.getAxioms(AxiomType.ANNOTATION_ASSERTION));
  System.out.println("String_Node_Str");
  GreedyCohaerencyExtractor ge=new GreedyCohaerencyExtractor();
  ge.getCoherentOntology(schema,target,stepSize);
}
Program: 9537
Project: 9537
Buggy source:
public void setHeuristic(OEHeuristicRuntime heuristic){
  this.heuristic=heuristic;
}

Fixed version (ground truth):
@Autowired(required=false) public void setHeuristic(OEHeuristicRuntime heuristic){
  this.heuristic=heuristic;
}
Program: 9538
Project: 9538
Buggy source:
private void runSPARQL1_0_Mode(){
  Model model=ModelFactory.createDefaultModel();
  int limit=1000;
  int offset=0;
  String baseQuery="String_Node_Str";
  String query=String.format(baseQuery,classToDescribe.getName(),classToDescribe.getName(),limit,offset);
  System.out.println(query);
  Model newModel=executeConstructQuery(query);
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  NamedClass cls;
  while (newModel.size() != 0) {
    model.add(newModel);
    query="String_Node_Str";
    ResultSet rs=executeSelectQuery(query,model);
    int total=rs.next().getLiteral("String_Node_Str").getInt();
    query="String_Node_Str" + "String_Node_Str";
    rs=executeSelectQuery(query,model);
    QuerySolution qs;
    while (rs.hasNext()) {
      qs=rs.next();
      if (qs.getResource("String_Node_Str") != null && !qs.getResource("String_Node_Str").isAnon()) {
        cls=new NamedClass(qs.getResource("String_Node_Str").getURI());
        int newCnt=qs.getLiteral("String_Node_Str").getInt();
        result.put(cls,newCnt);
      }
    }
    if (!result.isEmpty()) {
      currentlyBestEvaluatedDescriptions=buildEvaluatedClassDescriptions(result,allClasses,total);
    }
    offset+=limit;
    query=String.format(baseQuery,classToDescribe.getName(),classToDescribe.getName(),limit,offset);
    newModel=executeConstructQuery(query);
  }
}

Fixed version (ground truth):
private void runSPARQL1_0_Mode(){
  Model model=ModelFactory.createDefaultModel();
  int limit=1000;
  int offset=0;
  String baseQuery="String_Node_Str";
  String query=String.format(baseQuery,classToDescribe.getName(),classToDescribe.getName(),limit,offset);
  Model newModel=executeConstructQuery(query);
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  NamedClass cls;
  while (newModel.size() != 0) {
    model.add(newModel);
    query="String_Node_Str";
    ResultSet rs=executeSelectQuery(query,model);
    int total=rs.next().getLiteral("String_Node_Str").getInt();
    query="String_Node_Str" + "String_Node_Str";
    rs=executeSelectQuery(query,model);
    QuerySolution qs;
    while (rs.hasNext()) {
      qs=rs.next();
      if (qs.getResource("String_Node_Str") != null && !qs.getResource("String_Node_Str").isAnon()) {
        cls=new NamedClass(qs.getResource("String_Node_Str").getURI());
        int newCnt=qs.getLiteral("String_Node_Str").getInt();
        result.put(cls,newCnt);
      }
    }
    if (!result.isEmpty()) {
      currentlyBestEvaluatedDescriptions=buildEvaluatedClassDescriptions(result,allClasses,total);
    }
    offset+=limit;
    query=String.format(baseQuery,classToDescribe.getName(),classToDescribe.getName(),limit,offset);
    newModel=executeConstructQuery(query);
  }
}
Program: 9539
Project: 9539
Buggy source:
private void runSPARQL1_0_Mode(){
  Model model=ModelFactory.createDefaultModel();
  int limit=1000;
  int offset=0;
  String baseQuery="String_Node_Str";
  String query=String.format(baseQuery,propertyToDescribe.getName(),limit,offset);
  Model newModel=executeConstructQuery(query);
  Map<ObjectProperty,Integer> result=new HashMap<ObjectProperty,Integer>();
  while (!terminationCriteriaSatisfied() && newModel.size() != 0) {
    model.add(newModel);
    query="String_Node_Str";
    ObjectProperty prop;
    Integer oldCnt;
    ResultSet rs=executeSelectQuery(query,model);
    QuerySolution qs;
    while (rs.hasNext()) {
      qs=rs.next();
      prop=new ObjectProperty(qs.getResource("String_Node_Str").getURI());
      int newCnt=qs.getLiteral("String_Node_Str").getInt();
      oldCnt=result.get(prop);
      if (oldCnt == null) {
        oldCnt=Integer.valueOf(newCnt);
      }
      result.put(prop,oldCnt);
      qs.getLiteral("String_Node_Str").getInt();
    }
    if (!result.isEmpty()) {
      currentlyBestAxioms=buildAxioms(result,allObjectProperties);
    }
    offset+=limit;
    query=String.format(baseQuery,propertyToDescribe.getName(),propertyToDescribe.getName(),limit,offset);
    newModel=executeConstructQuery(query);
  }
}

Fixed version (ground truth):
private void runSPARQL1_0_Mode(){
  Model model=ModelFactory.createDefaultModel();
  int limit=1000;
  int offset=0;
  String baseQuery="String_Node_Str";
  String query=String.format(baseQuery,propertyToDescribe.getName(),limit,offset);
  Model newModel=executeConstructQuery(query);
  Map<ObjectProperty,Integer> result=new HashMap<ObjectProperty,Integer>();
  while (!terminationCriteriaSatisfied() && newModel.size() != 0) {
    model.add(newModel);
    query="String_Node_Str";
    ObjectProperty prop;
    Integer oldCnt;
    ResultSet rs=executeSelectQuery(query,model);
    QuerySolution qs;
    while (rs.hasNext()) {
      qs=rs.next();
      prop=new ObjectProperty(qs.getResource("String_Node_Str").getURI());
      int newCnt=qs.getLiteral("String_Node_Str").getInt();
      oldCnt=result.get(prop);
      if (oldCnt == null) {
        oldCnt=Integer.valueOf(newCnt);
      }
      result.put(prop,oldCnt);
      qs.getLiteral("String_Node_Str").getInt();
    }
    if (!result.isEmpty()) {
      currentlyBestAxioms=buildAxioms(result,allObjectProperties);
    }
    offset+=limit;
    query=String.format(baseQuery,propertyToDescribe.getName(),limit,offset);
    newModel=executeConstructQuery(query);
  }
}
Program: 9540
Project: 9540
Buggy source:
public Set<NamedClass> getAllClasses(){
  Set<NamedClass> classes=new TreeSet<NamedClass>();
  String query="String_Node_Str";
  SparqlQuery sq=new SparqlQuery(query,sparqlEndpoint);
  ResultSet q=sq.send(false);
  while (q.hasNext()) {
    QuerySolution qs=q.next();
    if (qs.getResource("String_Node_Str").isURIResource()) {
      classes.add(new NamedClass(qs.getResource("String_Node_Str").getURI()));
    }
  }
  classes.remove(OWL.Nothing.toStringID());
  classes.remove(OWL.Thing.toStringID());
  return classes;
}

Fixed version (ground truth):
public Set<NamedClass> getAllClasses(){
  Set<NamedClass> classes=new TreeSet<NamedClass>();
  String query="String_Node_Str";
  SparqlQuery sq=new SparqlQuery(query,sparqlEndpoint);
  ResultSet q=sq.send(false);
  while (q.hasNext()) {
    QuerySolution qs=q.next();
    if (qs.getResource("String_Node_Str").isURIResource()) {
      classes.add(new NamedClass(qs.getResource("String_Node_Str").getURI()));
    }
  }
  classes.remove(new NamedClass(OWL.Nothing.toStringID()));
  classes.remove(new NamedClass(OWL.Thing.toStringID()));
  return classes;
}