try
{
otherProfile = getUserDatabase().findByLoginName( profile.getLoginName() );
if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
{
throw new DuplicateUserException( "The login name '" + profile.getLoginName() + "' is already taken." );
}
}
catch( NoSuchPrincipalException e )
{
}
try
{
otherProfile = getUserDatabase().findByFullName( profile.getFullname() );
if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
{
throw new DuplicateUserException( "The full name '" + profile.getFullname() + "' is already taken." );
}
}
catch( NoSuchPrincipalException e )
{
}