simplify code

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425055 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-21 17:54:37 +00:00
parent 523213b737
commit 09208ec81a
1 changed files with 3 additions and 38 deletions

View File

@ -244,42 +244,7 @@ public class ArchivaConfigurableUsersManager
public User getGuestUser()
throws UserNotFoundException, UserManagerException
{
User user = null;
if ( useUsersCache() )
{
user = (User) usersCache.get( GUEST_USERNAME );
if ( user != null )
{
return user;
}
}
UserNotFoundException lastException = null;
for ( UserManager userManager : userManagerPerId.values() )
{
try
{
user = userManager.getGuestUser();
if ( user != null )
{
if ( useUsersCache() )
{
usersCache.put( user.getUsername(), user );
}
return user;
}
}
catch ( UserNotFoundException e )
{
lastException = e;
}
}
if ( user == null && lastException != null )
{
throw lastException;
}
return user;
return findUser( GUEST_USERNAME );
}
@Override