Program: 61353
Project: 61353
Buggy source:
public SyncopeRole createSyncopeRole(RoleTO roleTO) throws SyncopeClientCompositeErrorException {
  SyncopeRole syncopeRole=new SyncopeRole();
  SyncopeClientCompositeErrorException scce=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
  SyncopeClientException invalidRoles=new SyncopeClientException(SyncopeClientExceptionType.InvalidRoles);
  if (roleTO.getName() == null) {
    log.error("String_Node_Str");
    invalidRoles.addElement("String_Node_Str");
  }
 else {
    syncopeRole.setName(roleTO.getName());
  }
  Long parentRoleId=null;
  if (roleTO.getParent() != null) {
    SyncopeRole parentRole=syncopeRoleDAO.find(roleTO.getParent());
    if (parentRole == null) {
      log.error("String_Node_Str" + roleTO.getParent());
      invalidRoles.addElement(String.valueOf(roleTO.getParent()));
    }
 else {
      syncopeRole.setParent(parentRole);
      parentRoleId=syncopeRole.getParent().getId();
    }
  }
  SyncopeRole otherRole=syncopeRoleDAO.find(roleTO.getName(),parentRoleId);
  if (otherRole != null) {
    log.error("String_Node_Str" + "String_Node_Str" + otherRole);
    invalidRoles.addElement(roleTO.getName());
  }
  if (!invalidRoles.getElements().isEmpty()) {
    scce.addException(invalidRoles);
  }
  syncopeRole=fillAbstractAttributable(syncopeRole,roleTO,AttributableUtil.ROLE,scce);
  SyncopeUser user=null;
  for (  Long userId : roleTO.getUsers()) {
    user=syncopeUserDAO.find(userId);
    if (user == null) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + userId);
      }
    }
 else {
      syncopeRole.addUser(user);
      user.addRole(syncopeRole);
    }
  }
  return syncopeRole;
}

Fixed version (ground truth):
public SyncopeRole createSyncopeRole(RoleTO roleTO) throws SyncopeClientCompositeErrorException {
  SyncopeRole syncopeRole=new SyncopeRole();
  syncopeRole.setInheritAttributes(roleTO.isInheritAttributes());
  syncopeRole.setInheritDerivedAttributes(roleTO.isInheritDerivedAttributes());
  SyncopeClientCompositeErrorException scce=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
  SyncopeClientException invalidRoles=new SyncopeClientException(SyncopeClientExceptionType.InvalidRoles);
  if (roleTO.getName() == null) {
    log.error("String_Node_Str");
    invalidRoles.addElement("String_Node_Str");
  }
 else {
    syncopeRole.setName(roleTO.getName());
  }
  Long parentRoleId=null;
  if (roleTO.getParent() != null) {
    SyncopeRole parentRole=syncopeRoleDAO.find(roleTO.getParent());
    if (parentRole == null) {
      log.error("String_Node_Str" + roleTO.getParent());
      invalidRoles.addElement(String.valueOf(roleTO.getParent()));
    }
 else {
      syncopeRole.setParent(parentRole);
      parentRoleId=syncopeRole.getParent().getId();
    }
  }
  SyncopeRole otherRole=syncopeRoleDAO.find(roleTO.getName(),parentRoleId);
  if (otherRole != null) {
    log.error("String_Node_Str" + "String_Node_Str" + otherRole);
    invalidRoles.addElement(roleTO.getName());
  }
  if (!invalidRoles.getElements().isEmpty()) {
    scce.addException(invalidRoles);
  }
  syncopeRole=fillAbstractAttributable(syncopeRole,roleTO,AttributableUtil.ROLE,scce);
  SyncopeUser user=null;
  for (  Long userId : roleTO.getUsers()) {
    user=syncopeUserDAO.find(userId);
    if (user == null) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + userId);
      }
    }
 else {
      syncopeRole.addUser(user);
      user.addRole(syncopeRole);
    }
  }
  return syncopeRole;
}