try
{
otherProfile = getUserDatabase().findByLoginName( profile.getLoginName() );
if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
{
throw new DuplicateUserException( "security.error.login.taken", profile.getLoginName() );
}
}
catch( NoSuchPrincipalException e )
{
}
try
{
otherProfile = getUserDatabase().findByFullName( profile.getFullname() );
if ( otherProfile != null && !otherProfile.equals( oldProfile ) )
{
throw new DuplicateUserException( "security.error.fullname.taken", profile.getFullname() );
}
}
catch( NoSuchPrincipalException e )
{
}