mirror of https://github.com/apache/archiva.git
simplify code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425055 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
523213b737
commit
09208ec81a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue