Program: 47474
Project: 47474
Buggy source:
/** 
 */
private void createDefaultUsersAndRoles(ITenant defaultTenant){
  IPentahoRole role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
  }
  role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
  }
  roleBindingDao.setRoleBindings(defaultTenant,"String_Node_Str",Arrays.asList(new String[]{IAuthorizationPolicy.MANAGE_SCHEDULING}));
  role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
  }
  roleBindingDao.setRoleBindings(defaultTenant,"String_Node_Str",Arrays.asList(new String[]{}));
  role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
  }
  roleBindingDao.setRoleBindings(defaultTenant,"String_Node_Str",Arrays.asList(new String[]{IAuthorizationPolicy.MANAGE_SCHEDULING}));
  IPentahoUser user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{authenticatedRoleName,"String_Node_Str"});
  }
  user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{authenticatedRoleName,"String_Node_Str"});
  }
  user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{authenticatedRoleName,"String_Node_Str"});
  }
  user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{tenantAdminRoleName,authenticatedRoleName,"String_Node_Str"});
  }
}

Fixed version (ground truth):
/** 
 */
private void createDefaultUsersAndRoles(ITenant defaultTenant){
  IPentahoRole role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
  }
  role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
    roleBindingDao.setRoleBindings(defaultTenant,"String_Node_Str",Arrays.asList(new String[]{IAuthorizationPolicy.MANAGE_SCHEDULING}));
  }
  role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
    roleBindingDao.setRoleBindings(defaultTenant,"String_Node_Str",Arrays.asList(new String[]{}));
  }
  role=userRoleDao.getRole(defaultTenant,"String_Node_Str");
  if (role == null) {
    userRoleDao.createRole(defaultTenant,"String_Node_Str","String_Node_Str",new String[0]);
    roleBindingDao.setRoleBindings(defaultTenant,"String_Node_Str",Arrays.asList(new String[]{IAuthorizationPolicy.MANAGE_SCHEDULING}));
  }
  IPentahoUser user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{authenticatedRoleName,"String_Node_Str"});
  }
  user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{authenticatedRoleName,"String_Node_Str"});
  }
  user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{authenticatedRoleName,"String_Node_Str"});
  }
  user=userRoleDao.getUser(defaultTenant,"String_Node_Str");
  if (user == null) {
    userRoleDao.createUser(defaultTenant,"String_Node_Str","String_Node_Str","String_Node_Str",new String[]{tenantAdminRoleName,authenticatedRoleName,"String_Node_Str"});
  }
}