Program: 109389
Project: 109389
Buggy source:
/** 
 * Gets lists of   {@link ProblemSummary} objects organized by {@link IssueCategoryModel}.
 */
public static Map<IssueCategoryModel,List<ProblemSummary>> getProblemSummaries(GraphRewrite event,Set<ProjectModel> projectModels,Set<String> includeTags,Set<String> excludeTags){
  Map<IssueCategoryModel,List<ProblemSummary>> results=new TreeMap<>(new IssueCategoryModel.IssueSummaryPriorityComparator());
  Map<RuleSummaryKey,ProblemSummary> ruleToSummary=new HashMap<>();
  InlineHintService hintService=new InlineHintService(event.getGraphContext());
  final Iterable<InlineHintModel> hints=projectModels == null ? hintService.findAll() : hintService.getHintsForProjects(projectModels);
  for (  InlineHintModel hint : hints) {
    Set<String> tags=hint.getTags();
    if (!TagUtil.checkMatchingTags(tags,includeTags,excludeTags,false))     continue;
    RuleSummaryKey key=new RuleSummaryKey(hint.getEffort(),hint.getRuleID(),hint.getTitle());
    ProblemSummary summary=ruleToSummary.get(key);
    if (summary == null) {
      summary=new ProblemSummary(UUID.randomUUID().toString(),hint.getIssueCategory(),hint.getRuleID(),hint.getTitle(),1,hint.getEffort());
      for (      LinkModel link : hint.getLinks()) {
        summary.addLink(link.getDescription(),link.getLink());
      }
      ruleToSummary.put(key,summary);
      addToResults(results,summary);
    }
 else {
      summary.setNumberFound(summary.getNumberFound() + 1);
    }
    summary.addFile(hint.getHint(),hint.getFile());
  }
  ClassificationService classificationService=new ClassificationService(event.getGraphContext());
  for (  ClassificationModel classification : classificationService.findAll()) {
    Set<String> tags=classification.getTags();
    if (!TagUtil.checkMatchingTags(tags,includeTags,excludeTags,false))     continue;
    List<FileModel> newFileModels=new ArrayList<>();
    for (    FileModel file : classification.getFileModels()) {
      if (projectModels != null) {
        if (!projectModels.contains(file.getProjectModel()))         continue;
      }
      newFileModels.add(file);
    }
    if (newFileModels.isEmpty())     continue;
    RuleSummaryKey key=new RuleSummaryKey(classification.getEffort(),classification.getRuleID(),classification.getClassification());
    ProblemSummary summary=ruleToSummary.get(key);
    if (summary == null) {
      summary=new ProblemSummary(UUID.randomUUID().toString(),classification.getIssueCategory(),classification.getRuleID(),classification.getClassification(),0,classification.getEffort());
      for (      LinkModel link : classification.getLinks()) {
        summary.addLink(link.getDescription(),link.getLink());
      }
      ruleToSummary.put(key,summary);
      addToResults(results,summary);
    }
    for (    FileModel file : newFileModels)     summary.addFile(classification.getDescription(),file);
    summary.setNumberFound(summary.getNumberFound() + newFileModels.size());
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Gets lists of   {@link ProblemSummary} objects organized by {@link IssueCategoryModel}.
 */
public static Map<IssueCategoryModel,List<ProblemSummary>> getProblemSummaries(GraphContext graphContext,Set<ProjectModel> projectModels,Set<String> includeTags,Set<String> excludeTags){
  Map<IssueCategoryModel,List<ProblemSummary>> results=new TreeMap<>(new IssueCategoryModel.IssueSummaryPriorityComparator());
  Map<RuleSummaryKey,ProblemSummary> ruleToSummary=new HashMap<>();
  InlineHintService hintService=new InlineHintService(graphContext);
  final Iterable<InlineHintModel> hints=projectModels == null ? hintService.findAll() : hintService.getHintsForProjects(projectModels);
  for (  InlineHintModel hint : hints) {
    Set<String> tags=hint.getTags();
    if (!TagUtil.checkMatchingTags(tags,includeTags,excludeTags,false))     continue;
    RuleSummaryKey key=new RuleSummaryKey(hint.getEffort(),hint.getRuleID(),hint.getTitle());
    ProblemSummary summary=ruleToSummary.get(key);
    if (summary == null) {
      summary=new ProblemSummary(UUID.randomUUID().toString(),hint.getIssueCategory(),hint.getRuleID(),hint.getTitle(),1,hint.getEffort());
      for (      LinkModel link : hint.getLinks()) {
        summary.addLink(link.getDescription(),link.getLink());
      }
      ruleToSummary.put(key,summary);
      addToResults(results,summary);
    }
 else {
      summary.setNumberFound(summary.getNumberFound() + 1);
    }
    summary.addFile(hint.getHint(),hint.getFile());
  }
  ClassificationService classificationService=new ClassificationService(graphContext);
  for (  ClassificationModel classification : classificationService.findAll()) {
    Set<String> tags=classification.getTags();
    if (!TagUtil.checkMatchingTags(tags,includeTags,excludeTags,false))     continue;
    List<FileModel> newFileModels=new ArrayList<>();
    for (    FileModel file : classification.getFileModels()) {
      if (projectModels != null) {
        if (!projectModels.contains(file.getProjectModel()))         continue;
      }
      newFileModels.add(file);
    }
    if (newFileModels.isEmpty())     continue;
    RuleSummaryKey key=new RuleSummaryKey(classification.getEffort(),classification.getRuleID(),classification.getClassification());
    ProblemSummary summary=ruleToSummary.get(key);
    if (summary == null) {
      summary=new ProblemSummary(UUID.randomUUID().toString(),classification.getIssueCategory(),classification.getRuleID(),classification.getClassification(),0,classification.getEffort());
      for (      LinkModel link : classification.getLinks()) {
        summary.addLink(link.getDescription(),link.getLink());
      }
      ruleToSummary.put(key,summary);
      addToResults(results,summary);
    }
    for (    FileModel file : newFileModels)     summary.addFile(classification.getDescription(),file);
    summary.setNumberFound(summary.getNumberFound() + newFileModels.size());
  }
  return results;
}