nus-yam/ex-repair huggingface dataset:
Program: 9589
Project: 9589
Buggy source:
private Query convert(DRS drs,Query query,boolean negate){
  redundantEqualRenaming(drs);
  if (!restructureEmpty(drs)) {
    return null;
  }
  for (  DiscourseReferent referent : drs.getDRs()) {
    if (referent.isMarked()) {
      SPARQL_Term term=new SPARQL_Term(referent.toString().replace("String_Node_Str","String_Node_Str"));
      term.setIsVariable(true);
      query.addSelTerm(term);
    }
    if (referent.isNonexistential()) {
      SPARQL_Term term=new SPARQL_Term(referent.getValue());
      term.setIsVariable(true);
      SPARQL_Filter f=new SPARQL_Filter();
      f.addNotBound(term);
      query.addFilter(f);
    }
    for (    Slot s : slots) {
      if (s.getAnchor().equals(referent.toString())) {
        template.addSlot(s);
        break;
      }
    }
  }
  Set<SPARQL_Triple> statements=new HashSet<SPARQL_Triple>();
  for (  DRS_Condition condition : drs.getConditions()) {
    Set<SPARQL_Triple> scondition=convertCondition(condition,query).getConditions();
    statements.addAll(scondition);
    if (negate) {
      for (int i=0; i < scondition.size(); ++i) {
        SPARQL_Term term=((SPARQL_Triple)scondition.toArray()[i]).getVariable();
        if (query.isSelTerm(term)) {
          SPARQL_Filter f=new SPARQL_Filter();
          f.addNotBound(term);
          query.addFilter(f);
        }
      }
    }
  }
  if (query.getSelTerms().size() == 0)   query.setQt(SPARQL_QueryType.ASK);
  query.setConditions(statements);
  return query;
}

Fixed version (ground truth):
private Query convert(DRS drs,Query query,boolean negate){
  redundantEqualRenaming(drs);
  if (!restructureEmpty(drs)) {
    return null;
  }
  for (  DiscourseReferent referent : drs.collectDRs()) {
    if (referent.isMarked()) {
      SPARQL_Term term=new SPARQL_Term(referent.toString().replace("String_Node_Str","String_Node_Str"));
      term.setIsVariable(true);
      query.addSelTerm(term);
    }
    if (referent.isNonexistential()) {
      SPARQL_Term term=new SPARQL_Term(referent.getValue());
      term.setIsVariable(true);
      SPARQL_Filter f=new SPARQL_Filter();
      f.addNotBound(term);
      query.addFilter(f);
    }
    for (    Slot s : slots) {
      if (s.getAnchor().equals(referent.getValue()) || s.getAnchor().equals(referent.toString())) {
        template.addSlot(s);
        break;
      }
    }
  }
  Set<SPARQL_Triple> statements=new HashSet<SPARQL_Triple>();
  for (  DRS_Condition condition : drs.getConditions()) {
    Set<SPARQL_Triple> scondition=convertCondition(condition,query).getConditions();
    statements.addAll(scondition);
    if (negate) {
      for (int i=0; i < scondition.size(); ++i) {
        SPARQL_Term term=((SPARQL_Triple)scondition.toArray()[i]).getVariable();
        if (query.isSelTerm(term)) {
          SPARQL_Filter f=new SPARQL_Filter();
          f.addNotBound(term);
          query.addFilter(f);
        }
      }
    }
  }
  if (query.getSelTerms().size() == 0)   query.setQt(SPARQL_QueryType.ASK);
  query.setConditions(statements);
  return query;
}
Program: 9591
Project: 9591
Buggy source:
/** 
 * @param args
 * @throws NoTemplateFoundException 
 * @throws IOException 
 * @throws FileNotFoundException 
 * @throws InvalidFileFormatException 
 */
public static void main(String[] args) throws NoTemplateFoundException, InvalidFileFormatException, FileNotFoundException, IOException {
  String question="String_Node_Str";
  SPARQLTemplateBasedLearner learner=new SPARQLTemplateBasedLearner();
  SparqlEndpoint endpoint=new SparqlEndpoint(new URL("String_Node_Str"),Collections.<String>singletonList("String_Node_Str"),Collections.<String>emptyList());
  learner.setEndpoint(endpoint);
  learner.setQuestion(question);
  learner.learnSPARQLQueries();
  System.out.println("String_Node_Str" + learner.getBestSPARQLQuery());
  System.out.println("String_Node_Str" + learner.getTemplates().iterator().next().getLexicalAnswerType());
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws NoTemplateFoundException 
 * @throws IOException 
 * @throws FileNotFoundException 
 * @throws InvalidFileFormatException 
 */
public static void main(String[] args) throws NoTemplateFoundException, InvalidFileFormatException, FileNotFoundException, IOException {
  String question="String_Node_Str";
  SPARQLTemplateBasedLearner learner=new SPARQLTemplateBasedLearner();
  learner.setUseIdealTagger(true);
  SparqlEndpoint endpoint=new SparqlEndpoint(new URL("String_Node_Str"),Collections.<String>singletonList("String_Node_Str"),Collections.<String>emptyList());
  learner.setEndpoint(endpoint);
  learner.setQuestion(question);
  learner.learnSPARQLQueries();
  System.out.println("String_Node_Str" + learner.getBestSPARQLQuery());
  System.out.println("String_Node_Str" + learner.getTemplates().iterator().next().getLexicalAnswerType());
}
Program: 9592
Project: 9592
Buggy source:
public void learnSPARQLQueries() throws NoTemplateFoundException {
  reset();
  logger.info("String_Node_Str");
  mon.start();
  templates=templateGenerator.buildTemplates(question);
  mon.stop();
  logger.info("String_Node_Str" + mon.getLastValue() + "String_Node_Str");
  if (templates.isEmpty()) {
    throw new NoTemplateFoundException();
  }
  logger.info("String_Node_Str");
  for (  Template t : templates) {
    logger.info(t);
  }
  Set<WeightedQuery> weightedQueries=getWeightedSPARQLQueries(templates);
  sparqlQueryCandidates=new ArrayList<Query>();
  int i=0;
  for (  WeightedQuery wQ : weightedQueries) {
    sparqlQueryCandidates.add(wQ.getQuery());
    if (i == maxTestedQueries) {
      break;
    }
  }
  if (useRemoteEndpointValidation) {
    validateAgainstRemoteEndpoint(sparqlQueryCandidates);
  }
 else {
    validateAgainstLocalModel(sparqlQueryCandidates);
  }
}

Fixed version (ground truth):
public void learnSPARQLQueries() throws NoTemplateFoundException {
  reset();
  logger.info("String_Node_Str");
  mon.start();
  templates=templateGenerator.buildTemplates(question);
  mon.stop();
  logger.info("String_Node_Str" + mon.getLastValue() + "String_Node_Str");
  if (templates.isEmpty()) {
    throw new NoTemplateFoundException();
  }
  logger.info("String_Node_Str");
  for (  Template t : templates) {
    logger.info(t);
  }
  Set<WeightedQuery> weightedQueries=getWeightedSPARQLQueries(templates);
  sparqlQueryCandidates=new ArrayList<Query>();
  int i=0;
  for (  WeightedQuery wQ : weightedQueries) {
    sparqlQueryCandidates.add(wQ.getQuery());
    if (i == maxTestedQueries) {
      break;
    }
    i++;
  }
  if (useRemoteEndpointValidation) {
    validateAgainstRemoteEndpoint(sparqlQueryCandidates);
  }
 else {
    validateAgainstLocalModel(sparqlQueryCandidates);
  }
}
Program: 9600
Project: 9600
Buggy source:
public void replaceVarWithURI(String var,String uri){
  SPARQL_Value subject;
  SPARQL_Value property;
  SPARQL_Value object;
  uri="String_Node_Str" + uri + "String_Node_Str";
  for (  SPARQL_Triple triple : conditions) {
    subject=triple.getVariable();
    property=triple.getProperty();
    object=triple.getValue();
    if (subject.isVariable()) {
      if (subject.getName().equals(var)) {
        subject.setName(uri);
        subject.setIsVariable(false);
      }
    }
    if (property.isVariable()) {
      if (property.getName().equals(var)) {
        property.setName(uri);
        property.setIsVariable(false);
      }
    }
    if (object.isVariable()) {
      if (object.getName().equals(var)) {
        object.setName(uri);
        object.setIsVariable(false);
      }
    }
  }
}

Fixed version (ground truth):
public void replaceVarWithURI(String var,String uri){
  SPARQL_Term subject;
  SPARQL_Property property;
  SPARQL_Value object;
  uri="String_Node_Str" + uri + "String_Node_Str";
  for (  SPARQL_Triple triple : conditions) {
    subject=triple.getVariable();
    property=triple.getProperty();
    object=triple.getValue();
    if (subject.isVariable()) {
      if (subject.getName().equals(var)) {
        subject.setName(uri);
        subject.setIsVariable(false);
        subject.setIsURI(true);
      }
    }
    if (property.isVariable()) {
      if (property.getName().equals(var)) {
        property.setName(uri);
        property.setIsVariable(false);
      }
    }
    if (object.isVariable()) {
      if (object.getName().equals(var)) {
        object.setName(uri);
        object.setIsVariable(false);
        if (object instanceof SPARQL_Term) {
          ((SPARQL_Term)object).setIsURI(true);
        }
      }
    }
  }
}
Program: 9602
Project: 9602
Buggy source:
public void reverse(){
  SPARQL_Term newVariable=new SPARQL_Term(this.value.getName());
  newVariable.setIsVariable(this.value.isVariable());
  SPARQL_Value newValue=new SPARQL_Value(this.variable.getName());
  newValue.setIsVariable(this.variable.isVariable());
  this.variable=newVariable;
  this.value=newValue;
}

Fixed version (ground truth):
public void reverse(){
  SPARQL_Term newVariable=new SPARQL_Term(this.value.getName());
  newVariable.setIsVariable(this.value.isVariable());
  if (value instanceof SPARQL_Term) {
    newVariable.setIsURI(((SPARQL_Term)value).isURI);
  }
  SPARQL_Term newValue=new SPARQL_Term(this.variable.getName());
  newValue.setIsVariable(this.variable.isVariable());
  newValue.setIsURI(variable.isURI);
  this.variable=newVariable;
  this.value=newValue;
}
Program: 9604
Project: 9604
Buggy source:
/** 
 * @param args
 * @throws NoTemplateFoundException 
 * @throws IOException 
 * @throws FileNotFoundException 
 * @throws InvalidFileFormatException 
 */
public static void main(String[] args) throws NoTemplateFoundException, InvalidFileFormatException, FileNotFoundException, IOException {
  String question="String_Node_Str";
  SPARQLTemplateBasedLearner learner=new SPARQLTemplateBasedLearner();
  SparqlEndpoint endpoint=new SparqlEndpoint(new URL("String_Node_Str"),Collections.<String>singletonList("String_Node_Str"),Collections.<String>emptyList());
  learner.setEndpoint(endpoint);
  learner.setQuestion(question);
  learner.learnSPARQLQueries();
  System.out.println(learner.getBestSPARQLQuery());
  System.out.println(learner.getTemplates().iterator().next().getLexicalAnswerType());
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws NoTemplateFoundException 
 * @throws IOException 
 * @throws FileNotFoundException 
 * @throws InvalidFileFormatException 
 */
public static void main(String[] args) throws NoTemplateFoundException, InvalidFileFormatException, FileNotFoundException, IOException {
  String question="String_Node_Str";
  SPARQLTemplateBasedLearner learner=new SPARQLTemplateBasedLearner();
  SparqlEndpoint endpoint=new SparqlEndpoint(new URL("String_Node_Str"),Collections.<String>singletonList("String_Node_Str"),Collections.<String>emptyList());
  learner.setEndpoint(endpoint);
  learner.setQuestion(question);
  learner.learnSPARQLQueries();
  System.out.println("String_Node_Str" + learner.getBestSPARQLQuery());
  System.out.println("String_Node_Str" + learner.getTemplates().iterator().next().getLexicalAnswerType());
}
Program: 9606
Project: 9606
Buggy source:
public void replaceVarWithPrefixedURI(String var,String uri){
  SPARQL_Value subject;
  SPARQL_Value property;
  SPARQL_Value object;
  for (  SPARQL_Triple triple : conditions) {
    subject=triple.getVariable();
    property=triple.getProperty();
    object=triple.getValue();
    if (subject.isVariable()) {
      if (subject.getName().equals(var)) {
        subject.setName(uri);
        subject.setIsVariable(false);
      }
    }
    if (property.isVariable()) {
      if (property.getName().equals(var)) {
        property.setName(uri);
        property.setIsVariable(false);
      }
    }
    if (object.isVariable()) {
      if (object.getName().equals(var)) {
        object.setName(uri);
        object.setIsVariable(false);
      }
    }
  }
}

Fixed version (ground truth):
public void replaceVarWithPrefixedURI(String var,String uri){
  SPARQL_Term subject;
  SPARQL_Property property;
  SPARQL_Value object;
  for (  SPARQL_Triple triple : conditions) {
    subject=triple.getVariable();
    property=triple.getProperty();
    object=triple.getValue();
    if (subject.isVariable()) {
      if (subject.getName().equals(var)) {
        subject.setName(uri);
        subject.setIsVariable(false);
        subject.setIsURI(true);
      }
    }
    if (property.isVariable()) {
      if (property.getName().equals(var)) {
        property.setName(uri);
        property.setIsVariable(false);
      }
    }
    if (object.isVariable()) {
      if (object.getName().equals(var)) {
        object.setName(uri);
        object.setIsVariable(false);
        if (object instanceof SPARQL_Term) {
          ((SPARQL_Term)object).setIsURI(true);
        }
      }
    }
  }
}
Program: 9607
Project: 9607
Buggy source:
public static void main(String[] args){
  System.setProperty("String_Node_Str",System.getProperty("String_Node_Str") + "String_Node_Str");
  WordNetDatabase database=WordNetDatabase.getFileInstance();
  System.out.println(database.getBaseFormCandidates("String_Node_Str",SynsetType.NOUN)[1]);
  WordNet wordnet=new WordNet();
  System.out.println(wordnet.getAttributes("String_Node_Str"));
  System.out.println(wordnet.getBestSynonyms("String_Node_Str","String_Node_Str"));
  System.out.println(wordnet.getAttributes("String_Node_Str"));
  System.out.println(wordnet.getBestSynonyms("String_Node_Str","String_Node_Str"));
  System.out.println(wordnet.getAttributes("String_Node_Str"));
}

Fixed version (ground truth):
public static void main(String[] args){
  System.setProperty("String_Node_Str",System.getProperty("String_Node_Str") + "String_Node_Str");
  WordNetDatabase database=WordNetDatabase.getFileInstance();
  System.out.println(database.getBaseFormCandidates("String_Node_Str",SynsetType.NOUN)[1]);
  WordNet wordnet=new WordNet();
  System.out.println(wordnet.getAttributes("String_Node_Str"));
  System.out.println(wordnet.getBestSynonyms("String_Node_Str"));
  System.out.println(wordnet.getAttributes("String_Node_Str"));
  System.out.println(wordnet.getBestSynonyms("String_Node_Str"));
  System.out.println(wordnet.getAttributes("String_Node_Str"));
}
Program: 9608
Project: 9608
Buggy source:
@Override public ApplicationContext buildApplicationContext(IConfiguration configuration,List<Resource> springConfigurationLocations) throws IOException {
  ConfigurableApplicationContext context=null;
  BeanDefinitionRegistryPostProcessor beanDefinitionRegistryPostProcessor=new ConfigurationBasedBeanDefinitionRegistryPostProcessor(configuration);
  List<Resource> allSpringConfigFiles=new ArrayList<Resource>();
  allSpringConfigFiles.add(new ClassPathResource("String_Node_Str"));
  allSpringConfigFiles.addAll(springConfigurationLocations);
  String[] springConfigurationFiles=new String[allSpringConfigFiles.size()];
  int ctr=0;
  for (  Resource springConfigurationLocation : allSpringConfigFiles) {
    springConfigurationFiles[ctr]=springConfigurationLocation.getFile().toURI().toString();
    ctr++;
  }
  context=new ClassPathXmlApplicationContext(springConfigurationFiles,false);
  context.addBeanFactoryPostProcessor(beanDefinitionRegistryPostProcessor);
  context.refresh();
  return context;
}

Fixed version (ground truth):
@Override public ApplicationContext buildApplicationContext(IConfiguration configuration,List<Resource> springConfigurationLocations) throws IOException {
  ConfigurableApplicationContext context=null;
  BeanDefinitionRegistryPostProcessor beanDefinitionRegistryPostProcessor=new ConfigurationBasedBeanDefinitionRegistryPostProcessor(configuration);
  List<Resource> allSpringConfigFiles=new ArrayList<Resource>();
  allSpringConfigFiles.add(new ClassPathResource("String_Node_Str"));
  allSpringConfigFiles.addAll(springConfigurationLocations);
  String[] springConfigurationFiles=new String[allSpringConfigFiles.size()];
  int ctr=0;
  for (  Resource springConfigurationLocation : allSpringConfigFiles) {
    try {
      springConfigurationFiles[ctr]=springConfigurationLocation.getURL().toURI().toString();
    }
 catch (    URISyntaxException e) {
      e.printStackTrace();
    }
    ctr++;
  }
  context=new ClassPathXmlApplicationContext(springConfigurationFiles,false);
  context.addBeanFactoryPostProcessor(beanDefinitionRegistryPostProcessor);
  context.refresh();
  return context;
}
Program: 9609
Project: 9609
Buggy source:
public static int getMaxExecutionTimeInSeconds(){
  return maxExecutionTimeInSeconds;
}

Fixed version (ground truth):
public int getMaxExecutionTimeInSeconds(){
  return maxExecutionTimeInSeconds;
}
Program: 9610
Project: 9610
Buggy source:
public static void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds){
  ClassLearningProblem.maxExecutionTimeInSeconds=maxExecutionTimeInSeconds;
}

Fixed version (ground truth):
public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds){
  this.maxExecutionTimeInSeconds=maxExecutionTimeInSeconds;
}
Program: 9611
Project: 9611
Buggy source:
public FastInstanceChecker(Set<AbstractKnowledgeSource> sources){
  super(sources);
}

Fixed version (ground truth):
public FastInstanceChecker(AbstractKnowledgeSource... sources){
  super(new HashSet<AbstractKnowledgeSource>(Arrays.asList(sources)));
}
Program: 9613
Project: 9613
Buggy source:
public CommonPrefixMap(){
  put("String_Node_Str","String_Node_Str");
  put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public CommonPrefixMap(){
  put("String_Node_Str","String_Node_Str");
  put("String_Node_Str","String_Node_Str");
  put("String_Node_Str","String_Node_Str");
  put("String_Node_Str","String_Node_Str");
  put("String_Node_Str","String_Node_Str");
}
Program: 9614
Project: 9614
Buggy source:
private String prettyPrint(EvaluatedAxiom axiom){
  double acc=axiom.getScore().getAccuracy() * 100;
  String accs=df.format(acc);
  if (acc < 10d) {
    accs="String_Node_Str" + accs;
  }
  if (acc < 100d) {
    accs="String_Node_Str" + accs;
  }
  String str=accs + "String_Node_Str" + axiom.getAxiom().toManchesterSyntaxString(null,prefixes);
  return str;
}

Fixed version (ground truth):
private String prettyPrint(EvaluatedAxiom axiom){
  double acc=axiom.getScore().getAccuracy() * 100;
  String accs=df.format(acc);
  if (accs.length() == 3) {
    accs="String_Node_Str" + accs;
  }
  if (accs.length() == 4) {
    accs="String_Node_Str" + accs;
  }
  String str=accs + "String_Node_Str" + axiom.getAxiom().toManchesterSyntaxString(null,prefixes);
  return str;
}
Program: 9616
Project: 9616
Buggy source:
@SuppressWarnings("String_Node_Str") private void runClassLearningAlgorithms(SparqlEndpointKS ks,NamedClass nc) throws ComponentInitException {
  for (  Class<? extends LearningAlgorithm> algorithmClass : classAlgorithms) {
    if (algorithmClass == CELOE.class) {
      applyCELOE(ks,nc,false);
      applyCELOE(ks,nc,true);
    }
 else {
      applyLearningAlgorithm((Class<AxiomLearningAlgorithm>)algorithmClass,ks,nc);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void runClassLearningAlgorithms(SparqlEndpointKS ks,NamedClass nc) throws ComponentInitException {
  for (  Class<? extends LearningAlgorithm> algorithmClass : classAlgorithms) {
    if (algorithmClass == CELOE.class) {
      applyCELOE(ks,nc,false,false);
      applyCELOE(ks,nc,true,true);
    }
 else {
      applyLearningAlgorithm((Class<AxiomLearningAlgorithm>)algorithmClass,ks,nc);
    }
  }
}
Program: 9619
Project: 9619
Buggy source:
public final SortedSet<RDFNodeTuple> getTupelForResource(String uri){
  checkURIforValidity(uri);
  try {
    if (mode == NORMAL) {
      return retrieveTupel(uri);
    }
 else     if (mode == CLASSES_FOR_INSTANCES) {
      return retrieveClassesForInstances(uri);
    }
 else     if (mode == CLASS_INFORMATION) {
      return retrieveTuplesForClassesOnly(uri);
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + e.toString());
    return new TreeSet<RDFNodeTuple>();
  }
}

Fixed version (ground truth):
public final SortedSet<RDFNodeTuple> getTupelForResource(String uri){
  checkURIforValidity(uri);
  try {
    if (mode == NORMAL) {
      return retrieveTupel(uri);
    }
 else     if (mode == CLASSES_FOR_INSTANCES) {
      return retrieveClassesForInstances(uri);
    }
 else     if (mode == CLASS_INFORMATION) {
      return retrieveTuplesForClassesOnly(uri);
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + e.toString());
    e.printStackTrace();
    return new TreeSet<RDFNodeTuple>();
  }
}
Program: 9620
Project: 9620
Buggy source:
private boolean jj_3_2(){
  if (jj_3R_6())   return true;
  if (jj_scan_token(28))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_2(){
  if (jj_3R_6())   return true;
  if (jj_scan_token(16))   return true;
  return false;
}
Program: 9621
Project: 9621
Buggy source:
private boolean jj_3_1(){
  if (jj_3R_5())   return true;
  if (jj_scan_token(28))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_1(){
  if (jj_3R_5())   return true;
  if (jj_scan_token(16))   return true;
  return false;
}
Program: 9623
Project: 9623
Buggy source:
private boolean jj_3_6(){
  if (jj_scan_token(29))   return true;
  if (jj_scan_token(30))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_6(){
  if (jj_scan_token(17))   return true;
  if (jj_scan_token(18))   return true;
  return false;
}
Program: 9624
Project: 9624
Buggy source:
private boolean jj_3_5(){
  if (jj_scan_token(26))   return true;
  Token xsp;
  while (true) {
    xsp=jj_scanpos;
    if (jj_3_1()) {
      jj_scanpos=xsp;
      break;
    }
  }
  if (jj_3R_5())   return true;
  if (jj_scan_token(27))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_5(){
  if (jj_scan_token(14))   return true;
  Token xsp;
  while (true) {
    xsp=jj_scanpos;
    if (jj_3_1()) {
      jj_scanpos=xsp;
      break;
    }
  }
  if (jj_3R_5())   return true;
  if (jj_scan_token(15))   return true;
  return false;
}
Program: 9625
Project: 9625
Buggy source:
private boolean jj_3_4(){
  if (jj_scan_token(26))   return true;
  if (jj_scan_token(27))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_4(){
  if (jj_scan_token(14))   return true;
  if (jj_scan_token(15))   return true;
  return false;
}
Program: 9626
Project: 9626
Buggy source:
private boolean jj_3_3(){
  if (jj_scan_token(31))   return true;
  Token xsp;
  xsp=jj_scanpos;
  if (jj_3R_7()) {
    jj_scanpos=xsp;
    if (jj_3R_8())     return true;
  }
  if (jj_scan_token(28))   return true;
  xsp=jj_scanpos;
  if (jj_3R_9()) {
    jj_scanpos=xsp;
    if (jj_3R_10())     return true;
  }
  if (jj_scan_token(32))   return true;
  if (jj_scan_token(28))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_3(){
  if (jj_scan_token(19))   return true;
  Token xsp;
  xsp=jj_scanpos;
  if (jj_3R_7()) {
    jj_scanpos=xsp;
    if (jj_3R_8())     return true;
  }
  if (jj_scan_token(16))   return true;
  xsp=jj_scanpos;
  if (jj_3R_9()) {
    jj_scanpos=xsp;
    if (jj_3R_10())     return true;
  }
  if (jj_scan_token(20))   return true;
  if (jj_scan_token(16))   return true;
  return false;
}
Program: 9627
Project: 9627
Buggy source:
private boolean jj_3_7(){
  if (jj_scan_token(ID))   return true;
  if (jj_scan_token(33))   return true;
  return false;
}

Fixed version (ground truth):
private boolean jj_3_7(){
  if (jj_scan_token(ID))   return true;
  if (jj_scan_token(21))   return true;
  return false;
}
Program: 9628
Project: 9628
Buggy source:
final public String ComplexId() throws ParseException {
  Token t1, t2;
  if (jj_2_7(2)) {
    t1=jj_consume_token(ID);
    jj_consume_token(33);
    t2=jj_consume_token(ID);
{
      if (true)       return t1.image + "String_Node_Str" + t2.image;
    }
  }
 else {
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case ID:
      t1=jj_consume_token(ID);
{
      if (true)       return t1.image;
    }
  break;
default :
jj_la1[10]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
throw new Error("String_Node_Str");
}

Fixed version (ground truth):
final public String ComplexId() throws ParseException {
  Token t1, t2;
  if (jj_2_7(2)) {
    t1=jj_consume_token(ID);
    jj_consume_token(21);
    t2=jj_consume_token(ID);
{
      if (true)       return t1.image + "String_Node_Str" + t2.image;
    }
  }
 else {
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case ID:
      t1=jj_consume_token(ID);
{
      if (true)       return t1.image;
    }
  break;
default :
jj_la1[10]=jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
throw new Error("String_Node_Str");
}
Program: 9629
Project: 9629
Buggy source:
/** 
 * Generate ParseException. 
 */
public ParseException generateParseException(){
  jj_expentries.clear();
  boolean[] la1tokens=new boolean[34];
  if (jj_kind >= 0) {
    la1tokens[jj_kind]=true;
    jj_kind=-1;
  }
  for (int i=0; i < 11; i++) {
    if (jj_la1[i] == jj_gen) {
      for (int j=0; j < 32; j++) {
        if ((jj_la1_0[i] & (1 << j)) != 0) {
          la1tokens[j]=true;
        }
        if ((jj_la1_1[i] & (1 << j)) != 0) {
          la1tokens[32 + j]=true;
        }
      }
    }
  }
  for (int i=0; i < 34; i++) {
    if (la1tokens[i]) {
      jj_expentry=new int[1];
      jj_expentry[0]=i;
      jj_expentries.add(jj_expentry);
    }
  }
  jj_endpos=0;
  jj_rescan_token();
  jj_add_error_token(0,0);
  int[][] exptokseq=new int[jj_expentries.size()][];
  for (int i=0; i < jj_expentries.size(); i++) {
    exptokseq[i]=jj_expentries.get(i);
  }
  return new ParseException(token,exptokseq,tokenImage);
}

Fixed version (ground truth):
/** 
 * Generate ParseException. 
 */
public ParseException generateParseException(){
  jj_expentries.clear();
  boolean[] la1tokens=new boolean[22];
  if (jj_kind >= 0) {
    la1tokens[jj_kind]=true;
    jj_kind=-1;
  }
  for (int i=0; i < 11; i++) {
    if (jj_la1[i] == jj_gen) {
      for (int j=0; j < 32; j++) {
        if ((jj_la1_0[i] & (1 << j)) != 0) {
          la1tokens[j]=true;
        }
      }
    }
  }
  for (int i=0; i < 22; i++) {
    if (la1tokens[i]) {
      jj_expentry=new int[1];
      jj_expentry[0]=i;
      jj_expentries.add(jj_expentry);
    }
  }
  jj_endpos=0;
  jj_rescan_token();
  jj_add_error_token(0,0);
  int[][] exptokseq=new int[jj_expentries.size()][];
  for (int i=0; i < jj_expentries.size(); i++) {
    exptokseq[i]=jj_expentries.get(i);
  }
  return new ParseException(token,exptokseq,tokenImage);
}
Program: 9630
Project: 9630
Buggy source:
private static void jj_la1_init_0(){
  jj_la1_0=new int[]{0x1000,0x100,0x1001000,0x1001000,0x1001000,0x1001000,0x1007000,0x4000000,0x20000000,0x1001000,0x1000};
}

Fixed version (ground truth):
private static void jj_la1_init_0(){
  jj_la1_0=new int[]{0x200,0x100,0x1200,0x1200,0x1200,0x1200,0x1e00,0x4000,0x20000,0x1200,0x200};
}
Program: 9632
Project: 9632
Buggy source:
public static void main(String[] args) throws Exception {
  DisjointClassesLearner l=new DisjointClassesLearner(new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpedia()));
  l.setClassToDescribe(new NamedClass("String_Node_Str"));
  l.init();
  l.start();
  for (  EvaluatedDescription e : l.getCurrentlyBestEvaluatedDescriptions(300)) {
    System.out.println(e);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  DisjointClassesLearner l=new DisjointClassesLearner(new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpedia()));
  l.setClassToDescribe(new NamedClass("String_Node_Str"));
  l.init();
  l.start();
  for (  EvaluatedAxiom e : l.getCurrentlyBestEvaluatedAxioms(50)) {
    System.out.println(e);
  }
}
Program: 9633
Project: 9633
Buggy source:
@Override public List<Axiom> getCurrentlyBestAxioms(int nrOfAxioms){
  List<Axiom> bestAxioms=new ArrayList<Axiom>();
  Iterator<EvaluatedAxiom> it=currentlyBestAxioms.iterator();
  while (bestAxioms.size() < nrOfAxioms && it.hasNext()) {
    bestAxioms.add(it.next().getAxiom());
  }
  return bestAxioms;
}

Fixed version (ground truth):
@Override public List<Axiom> getCurrentlyBestAxioms(int nrOfAxioms){
  List<Axiom> bestAxioms=new ArrayList<Axiom>();
  for (  EvaluatedAxiom evAx : getCurrentlyBestEvaluatedAxioms(nrOfAxioms)) {
    bestAxioms.add(evAx.getAxiom());
  }
  return bestAxioms;
}
Program: 9634
Project: 9634
Buggy source:
public String toKBSyntaxString(String baseURI,Map<String,String> prefixes){
  throw new Error("String_Node_Str");
}

Fixed version (ground truth):
public String toKBSyntaxString(String baseURI,Map<String,String> prefixes){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  Iterator<Description> it=descriptions.iterator();
  while (it.hasNext()) {
    sb.append(it.next().toKBSyntaxString());
    if (it.hasNext()) {
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 9635
Project: 9635
Buggy source:
@Override public String toManchesterSyntaxString(String baseURI,Map<String,String> prefixes){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toManchesterSyntaxString(String baseURI,Map<String,String> prefixes){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  Iterator<Description> it=descriptions.iterator();
  while (it.hasNext()) {
    sb.append(it.next().toManchesterSyntaxString(baseURI,prefixes));
    if (it.hasNext()) {
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 9636
Project: 9636
Buggy source:
public String toString(String baseURI,Map<String,String> prefixes){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String toString(String baseURI,Map<String,String> prefixes){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  Iterator<Description> it=descriptions.iterator();
  while (it.hasNext()) {
    sb.append(it.next().toString());
    if (it.hasNext()) {
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 9637
Project: 9637
Buggy source:
private Model getModel(List<OWLAxiom> axioms){
  Model model=ModelFactory.createDefaultModel();
  try {
    Conversion.OWLAPIOntology2JenaModel(OWLManager.createOWLOntologyManager().createOntology(new HashSet<OWLAxiom>(axioms)),model);
  }
 catch (  OWLOntologyCreationException e) {
    e.printStackTrace();
  }
  return model;
}

Fixed version (ground truth):
private Model getModel(List<OWLAxiom> axioms){
  Model model=ModelFactory.createDefaultModel();
  try {
    OWLOntology ontology=OWLManager.createOWLOntologyManager().createOntology(new HashSet<OWLAxiom>(axioms));
    String s=new org.aksw.commons.owlapi.StringConverter(ontology).toStringAsTurtle();
    System.out.println(s);
    ByteArrayInputStream bs=new ByteArrayInputStream(s.getBytes());
    model.read(bs,"String_Node_Str","String_Node_Str");
  }
 catch (  OWLOntologyCreationException e) {
    e.printStackTrace();
  }
  return model;
}
Program: 9640
Project: 9640
Buggy source:
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  Description existingDomain=reasoner.getDomain(propertyToDescribe);
  logger.info("String_Node_Str" + existingDomain);
  Map<Individual,Set<NamedClass>> individual2Types=new HashMap<Individual,Set<NamedClass>>();
  Map<Individual,Set<NamedClass>> newIndividual2Types;
  boolean repeat=true;
  while (!terminationCriteriaSatisfied() && repeat) {
    newIndividual2Types=getSubjectsWithTypes(fetchedRows);
    individual2Types.putAll(newIndividual2Types);
    currentlyBestAxioms=buildBestAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=!newIndividual2Types.isEmpty();
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}

Fixed version (ground truth):
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  Description existingDomain=reasoner.getDomain(propertyToDescribe);
  logger.info("String_Node_Str" + existingDomain);
  Map<Individual,SortedSet<NamedClass>> individual2Types=new HashMap<Individual,SortedSet<NamedClass>>();
  boolean repeat=true;
  int limit=1000;
  while (!terminationCriteriaSatisfied() && repeat) {
    int ret=addIndividualsWithTypes(individual2Types,limit,fetchedRows);
    currentlyBestAxioms=buildEvaluatedAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=(ret == limit);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}
Program: 9641
Project: 9641
Buggy source:
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  DataRange existingRange=reasoner.getRange(propertyToDescribe);
  logger.debug("String_Node_Str" + existingRange);
  Map<Individual,Set<Datatype>> individual2Types=new HashMap<Individual,Set<Datatype>>();
  Map<Individual,Set<Datatype>> newIndividual2Types;
  boolean repeat=true;
  while (!terminationCriteriaSatisfied() && repeat) {
    newIndividual2Types=getObjectsWithDatatypes(fetchedRows);
    individual2Types.putAll(newIndividual2Types);
    currentlyBestAxioms=buildBestAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=!newIndividual2Types.isEmpty();
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}

Fixed version (ground truth):
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  DataRange existingRange=reasoner.getRange(propertyToDescribe);
  logger.debug("String_Node_Str" + existingRange);
  Map<Individual,SortedSet<Datatype>> individual2Datatypes=new HashMap<Individual,SortedSet<Datatype>>();
  boolean repeat=true;
  int limit=1000;
  while (!terminationCriteriaSatisfied() && repeat) {
    int ret=addIndividualsWithTypes(individual2Datatypes,limit,fetchedRows);
    currentlyBestAxioms=buildEvaluatedAxioms(individual2Datatypes);
    fetchedRows+=1000;
    repeat=(ret == limit);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}
Program: 9642
Project: 9642
Buggy source:
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  Description existingDomain=reasoner.getDomain(propertyToDescribe);
  logger.info("String_Node_Str" + existingDomain);
  Map<Individual,Set<NamedClass>> individual2Types=new HashMap<Individual,Set<NamedClass>>();
  Map<Individual,Set<NamedClass>> newIndividual2Types;
  boolean repeat=true;
  while (!terminationCriteriaSatisfied() && repeat) {
    newIndividual2Types=getSubjectsWithTypes(fetchedRows);
    individual2Types.putAll(newIndividual2Types);
    currentlyBestAxioms=buildBestAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=!newIndividual2Types.isEmpty();
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}

Fixed version (ground truth):
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  Description existingDomain=reasoner.getDomain(propertyToDescribe);
  logger.info("String_Node_Str" + existingDomain);
  Map<Individual,SortedSet<NamedClass>> individual2Types=new HashMap<Individual,SortedSet<NamedClass>>();
  boolean repeat=true;
  int limit=1000;
  while (!terminationCriteriaSatisfied() && repeat) {
    int ret=addIndividualsWithTypes(individual2Types,limit,fetchedRows);
    currentlyBestAxioms=buildEvaluatedAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=(ret == limit);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}
Program: 9643
Project: 9643
Buggy source:
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  Description existingRange=reasoner.getRange(propertyToDescribe);
  logger.debug("String_Node_Str" + existingRange);
  Map<Individual,Set<NamedClass>> individual2Types=new HashMap<Individual,Set<NamedClass>>();
  Map<Individual,Set<NamedClass>> newIndividual2Types;
  boolean repeat=true;
  while (!terminationCriteriaSatisfied() && repeat) {
    newIndividual2Types=getObjectsWithTypes(fetchedRows);
    individual2Types.putAll(newIndividual2Types);
    currentlyBestAxioms=buildBestAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=!newIndividual2Types.isEmpty();
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}

Fixed version (ground truth):
@Override public void start(){
  logger.info("String_Node_Str");
  startTime=System.currentTimeMillis();
  fetchedRows=0;
  currentlyBestAxioms=new ArrayList<EvaluatedAxiom>();
  Description existingRange=reasoner.getRange(propertyToDescribe);
  logger.debug("String_Node_Str" + existingRange);
  Map<Individual,SortedSet<NamedClass>> individual2Types=new HashMap<Individual,SortedSet<NamedClass>>();
  boolean repeat=true;
  int limit=1000;
  while (!terminationCriteriaSatisfied() && repeat) {
    int ret=addIndividualsWithTypes(individual2Types,limit,fetchedRows);
    currentlyBestAxioms=buildEvaluatedAxioms(individual2Types);
    fetchedRows+=1000;
    repeat=(ret == limit);
  }
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime));
}
Program: 9644
Project: 9644
Buggy source:
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<NamedClass>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  for (  Entry<Individual,Set<NamedClass>> entry : individual2Types.entrySet()) {
    for (    NamedClass nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
      result.put(nc,Integer.valueOf(cnt + 1));
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<NamedClass,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new DatatypePropertyDomainAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}

Fixed version (ground truth):
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<NamedClass>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  for (  Entry<Individual,Set<NamedClass>> entry : individual2Types.entrySet()) {
    for (    NamedClass nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
 else {
        cnt=Integer.valueOf(cnt + 1);
      }
      result.put(nc,cnt);
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<NamedClass,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new DatatypePropertyDomainAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}
Program: 9645
Project: 9645
Buggy source:
private Map<Individual,Set<Datatype>> getObjectsWithDatatypes(int offset){
  Map<Individual,Set<Datatype>> individual2Datatypes=new HashMap<Individual,Set<Datatype>>();
  int limit=1000;
  String query=String.format("String_Node_Str",propertyToDescribe.getName(),limit,offset);
  ResultSet rs=executeQuery(query);
  QuerySolution qs;
  Individual ind;
  Set<Datatype> types;
  while (rs.hasNext()) {
    qs=rs.next();
    ind=new Individual(qs.getResource("String_Node_Str").getURI());
    types=individual2Datatypes.get(ind);
    if (types == null) {
      types=new HashSet<Datatype>();
      individual2Datatypes.put(ind,types);
    }
    types.add(getDatatypeForURI(qs.getResource("String_Node_Str").getURI()));
  }
  return individual2Datatypes;
}

Fixed version (ground truth):
private Map<Individual,Set<Datatype>> getObjectsWithDatatypes(int offset){
  Map<Individual,Set<Datatype>> individual2Datatypes=new HashMap<Individual,Set<Datatype>>();
  int limit=1000;
  String query=String.format("String_Node_Str",propertyToDescribe.getName(),limit,offset);
  ResultSet rs=executeQuery(query);
  QuerySolution qs;
  Individual ind;
  Set<Datatype> types;
  while (rs.hasNext()) {
    qs=rs.next();
    ind=new Individual(qs.getResource("String_Node_Str").getURI());
    types=individual2Datatypes.get(ind);
    if (types == null) {
      types=new HashSet<Datatype>();
      individual2Datatypes.put(ind,types);
    }
    types.add(new Datatype(qs.getResource("String_Node_Str").getURI()));
  }
  return individual2Datatypes;
}
Program: 9646
Project: 9646
Buggy source:
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<Datatype>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<Datatype,Integer> result=new HashMap<Datatype,Integer>();
  for (  Entry<Individual,Set<Datatype>> entry : individual2Types.entrySet()) {
    for (    Datatype nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
      result.put(nc,Integer.valueOf(cnt + 1));
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<Datatype,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new DatatypePropertyRangeAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}

Fixed version (ground truth):
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<Datatype>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<Datatype,Integer> result=new HashMap<Datatype,Integer>();
  for (  Entry<Individual,Set<Datatype>> entry : individual2Types.entrySet()) {
    for (    Datatype nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
 else {
        cnt=Integer.valueOf(cnt + 1);
      }
      result.put(nc,cnt);
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<Datatype,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new DatatypePropertyRangeAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}
Program: 9647
Project: 9647
Buggy source:
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<NamedClass>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  for (  Entry<Individual,Set<NamedClass>> entry : individual2Types.entrySet()) {
    for (    NamedClass nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
      result.put(nc,Integer.valueOf(cnt + 1));
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<NamedClass,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new ObjectPropertyDomainAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}

Fixed version (ground truth):
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<NamedClass>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  for (  Entry<Individual,Set<NamedClass>> entry : individual2Types.entrySet()) {
    for (    NamedClass nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
 else {
        cnt=Integer.valueOf(cnt + 1);
      }
      result.put(nc,cnt);
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<NamedClass,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new ObjectPropertyDomainAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}
Program: 9648
Project: 9648
Buggy source:
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<NamedClass>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  for (  Entry<Individual,Set<NamedClass>> entry : individual2Types.entrySet()) {
    for (    NamedClass nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
      result.put(nc,Integer.valueOf(cnt + 1));
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<NamedClass,Integer> entry : sortByValues(result)) {
    evalAxiom=new EvaluatedAxiom(new ObjectPropertyRangeAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}

Fixed version (ground truth):
private List<EvaluatedAxiom> buildBestAxioms(Map<Individual,Set<NamedClass>> individual2Types){
  List<EvaluatedAxiom> axioms=new ArrayList<EvaluatedAxiom>();
  Map<NamedClass,Integer> result=new HashMap<NamedClass,Integer>();
  for (  Entry<Individual,Set<NamedClass>> entry : individual2Types.entrySet()) {
    for (    NamedClass nc : entry.getValue()) {
      Integer cnt=result.get(nc);
      if (cnt == null) {
        cnt=Integer.valueOf(1);
      }
 else {
        cnt=Integer.valueOf(cnt + 1);
      }
      result.put(nc,cnt);
    }
  }
  EvaluatedAxiom evalAxiom;
  for (  Entry<NamedClass,Integer> entry : sortByValues(result)) {
    System.out.println(entry.getKey());
    System.out.println(entry.getValue());
    evalAxiom=new EvaluatedAxiom(new ObjectPropertyRangeAxiom(propertyToDescribe,entry.getKey()),new AxiomScore(entry.getValue() / (double)individual2Types.keySet().size()));
    axioms.add(evalAxiom);
  }
  return axioms;
}
Program: 9650
Project: 9650
Buggy source:
private List<Query> getNBestQueryCandidatesForTemplates(Map<Template,Collection<? extends Query>> template2Queries){
  List<Query> queries=new ArrayList<Query>();
  for (  Entry<Template,Collection<? extends Query>> entry : template2Queries.entrySet()) {
    int max=Math.min(maxQueriesPerTemplate,entry.getValue().size());
    int i=0;
    for (    Query q : entry.getValue()) {
      queries.add(q);
      i++;
      if (i == max) {
        break;
      }
    }
  }
  return queries;
}

Fixed version (ground truth):
private List<Query> getNBestQueryCandidatesForTemplates(Map<Template,Collection<? extends Query>> template2Queries){
  List<Query> queries=new ArrayList<Query>();
  for (  Entry<Template,Collection<? extends Query>> entry : template2Queries.entrySet()) {
    int max=Math.min(maxTestedQueriesPerTemplate,entry.getValue().size());
    int i=0;
    for (    Query q : entry.getValue()) {
      queries.add(q);
      i++;
      if (i == max) {
        break;
      }
    }
  }
  return queries;
}