Program: 189405
Project: 189405
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);
      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();
      settingRepo.createConfiguration(Configuration.SUBMIT_INSTRUCTIONS,Configuration.DEFAULT_SUBMIT_INSTRUCTIONS).save();
      settingRepo.createConfiguration(Configuration.SUBMIT_LICENSE,Configuration.DEFAULT_SUBMIT_LICENSE).save();
      for (      EmbargoArray embargoDefinition : EMBARGO_DEFINTITIONS) {
        settingRepo.createEmbargoType(embargoDefinition.name,embargoDefinition.description,embargoDefinition.duration,embargoDefinition.active).save();
      }
      firstUser=false;
      Application.index();
    }
 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();
      settingRepo.createConfiguration(Configuration.SUBMIT_INSTRUCTIONS,Configuration.DEFAULT_SUBMIT_INSTRUCTIONS).save();
      settingRepo.createConfiguration(Configuration.SUBMIT_LICENSE,Configuration.DEFAULT_SUBMIT_LICENSE).save();
      for (      EmbargoArray embargoDefinition : EMBARGO_DEFINTITIONS) {
        settingRepo.createEmbargoType(embargoDefinition.name,embargoDefinition.description,embargoDefinition.duration,embargoDefinition.active).save();
      }
      indexer.deleteAndRebuild(true);
      firstUser=false;
      SettingsTab.settingsRedirect();
    }
 else {
      renderTemplate("String_Node_Str",firstName,lastName,email,password1,password2,netid);
    }
  }
  renderTemplate("String_Node_Str");
}