Program: 189338
Project: 189338
Buggy source:
public static void createUser(){
  if (firstUser == null || firstUser == false)   Application.index();
  if (params.get("String_Node_Str") != null) {
    String firstName=params.get("String_Node_Str");
    String lastName=params.get("String_Node_Str");
    String email=params.get("String_Node_Str");
    String password1=params.get("String_Node_Str");
    String password2=params.get("String_Node_Str");
    String netid=params.get("String_Node_Str");
    verify(firstName,lastName,email,password1,password2,netid);
    if (!validation.hasErrors()) {
      context.turnOffAuthorization();
      Person person=personRepo.createPerson(netid,email,firstName,lastName,RoleType.ADMINISTRATOR).save();
      person.setPassword(password1);
      person.save();
      context.turnOffAuthorization();
      context.login(person);
      List<AuthenticationMethod> methods=getEnabledAuthenticationMethods();
      for (      AuthenticationMethod method : methods)       method.personCreated(request,person);
      session.put("String_Node_Str",person.getId());
      session.put("String_Node_Str",person.getFirstName());
      session.put("String_Node_Str",person.getLastName());
      session.put("String_Node_Str",person.getDisplayName());
      systemEmailService.generateAllSystemEmailTemplates();
      new InitializeEmbargos().doJob(settingRepo);
      for (      String roleType : COMMITTEE_MEMBER_ROLE_TYPES_DEFINITIONS) {
        settingRepo.createCommitteeMemberRoleType(roleType,DegreeLevel.UNDERGRADUATE).save();
        settingRepo.createCommitteeMemberRoleType(roleType,DegreeLevel.MASTERS).save();
        settingRepo.createCommitteeMemberRoleType(roleType,DegreeLevel.DOCTORAL).save();
      }
      firstUser=false;
      try {
        SettingsTab.settingsRedirect();
      }
  finally {
        indexer.deleteAndRebuild(false);
      }
    }
 else {
      renderTemplate("String_Node_Str",firstName,lastName,email,password1,password2,netid);
    }
  }
  renderTemplate("String_Node_Str");
}

Fixed version (ground truth):
public static void createUser(){
  if (firstUser == null || firstUser == false)   Application.index();
  if (params.get("String_Node_Str") != null) {
    String firstName=params.get("String_Node_Str");
    String lastName=params.get("String_Node_Str");
    String email=params.get("String_Node_Str");
    String password1=params.get("String_Node_Str");
    String password2=params.get("String_Node_Str");
    String netid=params.get("String_Node_Str");
    verify(firstName,lastName,email,password1,password2,netid);
    if (!validation.hasErrors()) {
      context.turnOffAuthorization();
      Person person=personRepo.createPerson(netid,email,firstName,lastName,RoleType.ADMINISTRATOR).save();
      person.setPassword(password1);
      person.save();
      context.turnOffAuthorization();
      context.login(person);
      List<AuthenticationMethod> methods=getEnabledAuthenticationMethods();
      for (      AuthenticationMethod method : methods)       method.personCreated(request,person);
      session.put("String_Node_Str",person.getId());
      session.put("String_Node_Str",person.getFirstName());
      session.put("String_Node_Str",person.getLastName());
      session.put("String_Node_Str",person.getDisplayName());
      systemEmailService.generateAllSystemEmailTemplates();
      for (      String roleType : COMMITTEE_MEMBER_ROLE_TYPES_DEFINITIONS) {
        settingRepo.createCommitteeMemberRoleType(roleType,DegreeLevel.UNDERGRADUATE).save();
        settingRepo.createCommitteeMemberRoleType(roleType,DegreeLevel.MASTERS).save();
        settingRepo.createCommitteeMemberRoleType(roleType,DegreeLevel.DOCTORAL).save();
      }
      firstUser=false;
      try {
        SettingsTab.settingsRedirect();
      }
  finally {
        indexer.deleteAndRebuild(false);
      }
    }
 else {
      renderTemplate("String_Node_Str",firstName,lastName,email,password1,password2,netid);
    }
  }
  renderTemplate("String_Node_Str");
}