Program: 109388
Project: 109388
Buggy source:
@Override public Object exec(List arguments) throws TemplateModelException {
  if (arguments.size() == 0)   throw new TemplateModelException("String_Node_Str" + NAME + "String_Node_Str");
  final GraphRewrite event=(GraphRewrite)((StringModel)arguments.get(0)).getWrappedObject();
  final ProjectModel projectModel;
  StringModel projectModelArg=(StringModel)arguments.get(1);
  if (projectModelArg == null)   projectModel=null;
 else   projectModel=(ProjectModel)projectModelArg.getWrappedObject();
  Set<String> includeTags=FreeMarkerUtil.simpleSequenceToSet((SimpleSequence)arguments.get(2));
  Set<String> excludeTags=FreeMarkerUtil.simpleSequenceToSet((SimpleSequence)arguments.get(3));
  Set<ProjectModel> projectModels=getProjects(projectModel);
  Map<IssueCategoryModel,List<ProblemSummary>> problemSummariesOriginal=ProblemSummaryService.getProblemSummaries(event,projectModels,includeTags,excludeTags);
  Comparator<IssueCategoryModel> severityComparator=new IssueCategoryModel.IssueSummaryPriorityComparator();
  Map<IssueCategoryModel,List<ProblemSummary>> problemSummaries=new TreeMap<>(severityComparator);
  problemSummaries.putAll(problemSummariesOriginal);
  Map<String,List<ProblemSummary>> primarySummariesByString=new LinkedHashMap<>(problemSummariesOriginal.size());
  for (  Map.Entry<IssueCategoryModel,List<ProblemSummary>> entry : problemSummaries.entrySet()) {
    String severityString=entry.getKey() == null ? null : entry.getKey().getName();
    primarySummariesByString.put(severityString,entry.getValue());
  }
  return primarySummariesByString;
}

Fixed version (ground truth):
@Override public Object exec(List arguments) throws TemplateModelException {
  if (arguments.size() == 0)   throw new TemplateModelException("String_Node_Str" + NAME + "String_Node_Str");
  final GraphRewrite event=(GraphRewrite)((StringModel)arguments.get(0)).getWrappedObject();
  final ProjectModel projectModel;
  StringModel projectModelArg=(StringModel)arguments.get(1);
  if (projectModelArg == null)   projectModel=null;
 else   projectModel=(ProjectModel)projectModelArg.getWrappedObject();
  Set<String> includeTags=FreeMarkerUtil.simpleSequenceToSet((SimpleSequence)arguments.get(2));
  Set<String> excludeTags=FreeMarkerUtil.simpleSequenceToSet((SimpleSequence)arguments.get(3));
  Set<ProjectModel> projectModels=getProjects(projectModel);
  Map<IssueCategoryModel,List<ProblemSummary>> problemSummariesOriginal=ProblemSummaryService.getProblemSummaries(event.getGraphContext(),projectModels,includeTags,excludeTags);
  Comparator<IssueCategoryModel> severityComparator=new IssueCategoryModel.IssueSummaryPriorityComparator();
  Map<IssueCategoryModel,List<ProblemSummary>> problemSummaries=new TreeMap<>(severityComparator);
  problemSummaries.putAll(problemSummariesOriginal);
  Map<String,List<ProblemSummary>> primarySummariesByString=new LinkedHashMap<>(problemSummariesOriginal.size());
  for (  Map.Entry<IssueCategoryModel,List<ProblemSummary>> entry : problemSummaries.entrySet()) {
    String severityString=entry.getKey() == null ? null : entry.getKey().getName();
    primarySummariesByString.put(severityString,entry.getValue());
  }
  return primarySummariesByString;
}