Program: 189317
Project: 189317
Buggy source:
/** 
 * The main view method.
 */
@Security(RoleType.REVIEWER) public static void view(Long subId){
  Long id=subId;
  if (id == null) {
    flash.put("String_Node_Str","String_Node_Str");
    FilterTab.list();
  }
  Submission submission=subRepo.findSubmission(id);
  if (params.get("String_Node_Str") != null)   addActionLogComment(submission);
  if (params.get("String_Node_Str") != null)   changeStatus(submission);
  if (params.get("String_Node_Str") != null)   addFile(submission);
  if (params.get("String_Node_Str") != null)   editFile(submission);
  if (params.get("String_Node_Str") != null)   deleteFile(submission);
  JPA.em().detach(submission);
  submission=subRepo.findSubmission(id);
  Boolean isManager=context.isManager();
  if (submission == null) {
    FilterTab.list();
  }
  Person submitter=submission.getSubmitter();
  String advisorUrl=getAdvisorURL(submission);
  List<EmailTemplate> templates=settingRepo.findAllEmailTemplates();
  List<CustomActionDefinition> actions=settingRepo.findAllCustomActionDefinition();
  String gradMonth=null;
  if (submission.getGraduationMonth() != null)   gradMonth=new DateFormatSymbols().getMonths()[submission.getGraduationMonth()];
  List<ActionLog> actionLogs=subRepo.findActionLog(submission);
  List<State> states=stateManager.getAllStates();
  List<State> transitions=submission.getState().getTransitions(submission);
  List<CustomActionValue> actionValues=submission.getCustomActions();
  List<Person> assignees=personRepo.findPersonsByRole(RoleType.REVIEWER);
  List<DepositLocation> depositLocations=settingRepo.findAllDepositLocations();
  List<Attachment> attachments=submission.getAttachments();
  Collections.sort(attachments,new AttachmentSortByDate());
  List<String> attachmentTypes=new ArrayList<String>();
  for (  AttachmentType type : AttachmentType.values()) {
    attachmentTypes.add(type.toString());
  }
  List<EmbargoType> embargoTypes=settingRepo.findAllEmbargoTypes();
  String nav="String_Node_Str";
  render(nav,submission,submitter,isManager,advisorUrl,gradMonth,actionLogs,settingRepo,states,assignees,transitions,templates,actions,actionValues,depositLocations,attachments,attachmentTypes,embargoTypes);
}

Fixed version (ground truth):
/** 
 * The main view method.
 */
@Security(RoleType.REVIEWER) public static void view(Long subId){
  Long id=subId;
  if (id == null) {
    flash.put("String_Node_Str","String_Node_Str");
    FilterTab.list();
  }
  Submission submission=subRepo.findSubmission(id);
  if (params.get("String_Node_Str") != null)   addActionLogComment(submission);
  if (params.get("String_Node_Str") != null)   changeStatus(submission);
  if (params.get("String_Node_Str") != null)   addFile(submission);
  if (params.get("String_Node_Str") != null)   editFile(submission);
  if (params.get("String_Node_Str") != null)   deleteFile(submission);
  JPA.em().detach(submission);
  submission=subRepo.findSubmission(id);
  Boolean isManager=context.isManager();
  if (submission == null) {
    FilterTab.list();
  }
  Person submitter=submission.getSubmitter();
  String advisorUrl=getAdvisorURL(submission);
  List<EmailTemplate> templates=settingRepo.findAllEmailTemplates();
  List<CustomActionDefinition> actions=settingRepo.findAllCustomActionDefinition();
  String gradMonth=null;
  if (submission.getGraduationMonth() != null)   gradMonth=new DateFormatSymbols().getMonths()[submission.getGraduationMonth()];
  List<ActionLog> actionLogs=subRepo.findActionLog(submission);
  List<State> states=stateManager.getAllStates();
  List<State> transitions=submission.getState().getTransitions(submission);
  List<CustomActionValue> actionValues=submission.getCustomActions();
  List<Person> assignees=personRepo.findPersonsByRole(RoleType.REVIEWER);
  List<DepositLocation> depositLocations=settingRepo.findAllDepositLocations();
  List<Attachment> attachments=submission.getAttachments();
  Collections.sort(attachments,new AttachmentSortByDate());
  List<String> attachmentTypes=new ArrayList<String>();
  for (  AttachmentType type : AttachmentType.values()) {
    attachmentTypes.add(type.toString());
  }
  List<EmbargoType> embargoTypes=settingRepo.findAllEmbargoTypes();
  ArrayList<String> roles=new ArrayList<String>();
  for (  CommitteeMemberRoleType role : settingRepo.findAllCommitteeMemberRoleTypes()) {
    String encodedName=URIEncode(role.getName());
    if (!roles.contains(encodedName)) {
      roles.add(encodedName);
    }
  }
  String nav="String_Node_Str";
  render(nav,submission,submitter,isManager,advisorUrl,gradMonth,actionLogs,settingRepo,states,assignees,transitions,templates,actions,actionValues,depositLocations,attachments,attachmentTypes,embargoTypes,roles);
}