Program: 63029
Project: 63029
Buggy source:
private Set<CandidateEntity> generateCandidates(KnowledgeBase aKB,String aMention){
  if (aMention == null || aMention.isEmpty()) {
    return Collections.emptySet();
  }
  if (candidateCache.containsKey(aMention)) {
    return candidateCache.get(aMention);
  }
  Set<CandidateEntity> candidates=new HashSet<>();
  List<String> mentionList=Arrays.asList(aMention.split("String_Node_Str"));
  mentionList=mentionList.stream().map(m -> m.replaceAll("String_Node_Str","String_Node_Str")).collect(Collectors.toList());
  if (stopwords != null) {
    if (stopwords.containsAll(mentionList)) {
      logger.error("String_Node_Str",aMention);
      return Collections.emptySet();
    }
  }
  String processedMention=String.join("String_Node_Str",mentionList);
  if (processedMention.isEmpty()) {
    logger.error("String_Node_Str");
    return Collections.emptySet();
  }
  try (RepositoryConnection conn=kbService.getConnection(aKB)){
    TupleQuery query=QueryUtil.generateCandidateQuery(conn,processedMention,properties.getCandidateQueryLimit(),aKB.getDescriptionIri());
    try (TupleQueryResult entityResult=query.evaluate()){
      while (entityResult.hasNext()) {
        BindingSet solution=entityResult.next();
        Value e2=solution.getValue("String_Node_Str");
        Value label=solution.getValue("String_Node_Str");
        Value altLabel=solution.getValue("String_Node_Str");
        Value description=solution.getValue("String_Node_Str");
        CandidateEntity newEntity=new CandidateEntity((e2 != null) ? e2.stringValue() : "String_Node_Str",(label != null) ? label.stringValue() : "String_Node_Str",(altLabel != null) ? altLabel.stringValue() : "String_Node_Str",(description != null) ? description.stringValue() : "String_Node_Str");
        candidates.add(newEntity);
      }
    }
   }
 catch (  QueryEvaluationException e) {
    logger.error("String_Node_Str",e);
  }
  if (candidates.isEmpty()) {
    String[] split=processedMention.split("String_Node_Str");
    if (split.length > 1) {
      for (      String s : split) {
        candidates.addAll(generateCandidates(aKB,s));
      }
    }
  }
  candidateCache.put(processedMention,candidates);
  return candidates;
}

Fixed version (ground truth):
private Set<CandidateEntity> generateCandidates(KnowledgeBase aKB,String aMention){
  if (aMention == null || aMention.isEmpty()) {
    return Collections.emptySet();
  }
  Set<CandidateEntity> candidates=new HashSet<>();
  List<String> mentionList=Arrays.asList(aMention.split("String_Node_Str"));
  mentionList=mentionList.stream().map(m -> m.replaceAll("String_Node_Str","String_Node_Str")).collect(Collectors.toList());
  if (stopwords != null) {
    if (stopwords.containsAll(mentionList)) {
      logger.error("String_Node_Str",aMention);
      return Collections.emptySet();
    }
  }
  String processedMention=String.join("String_Node_Str",mentionList);
  if (processedMention.isEmpty()) {
    logger.error("String_Node_Str");
    return Collections.emptySet();
  }
  ImmutablePair<Project,String> pair=new ImmutablePair<>(aKB.getProject(),processedMention);
  if (candidateCache.containsKey(pair)) {
    return candidateCache.get(pair);
  }
  try (RepositoryConnection conn=kbService.getConnection(aKB)){
    TupleQuery query=QueryUtil.generateCandidateQuery(conn,processedMention,properties.getCandidateQueryLimit(),aKB.getDescriptionIri());
    try (TupleQueryResult entityResult=query.evaluate()){
      while (entityResult.hasNext()) {
        BindingSet solution=entityResult.next();
        Value e2=solution.getValue("String_Node_Str");
        Value label=solution.getValue("String_Node_Str");
        Value altLabel=solution.getValue("String_Node_Str");
        Value description=solution.getValue("String_Node_Str");
        CandidateEntity newEntity=new CandidateEntity((e2 != null) ? e2.stringValue() : "String_Node_Str",(label != null) ? label.stringValue() : "String_Node_Str",(altLabel != null) ? altLabel.stringValue() : "String_Node_Str",(description != null) ? description.stringValue() : "String_Node_Str");
        candidates.add(newEntity);
      }
    }
   }
 catch (  QueryEvaluationException e) {
    logger.error("String_Node_Str",e);
  }
  if (candidates.isEmpty()) {
    String[] split=processedMention.split("String_Node_Str");
    if (split.length > 1) {
      for (      String s : split) {
        candidates.addAll(generateCandidates(aKB,s));
      }
    }
  }
  candidateCache.put(pair,candidates);
  return candidates;
}