diff options
author | Olivier Lamy <olamy@apache.org> | 2012-12-21 17:54:37 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-12-21 17:54:37 +0000 |
commit | 09208ec81a34875ce2f013f158de4879f024e222 (patch) | |
tree | 8c0c3a5167fb3eda526dbd8b8037ed5e6b012e44 /archiva-modules/archiva-web/archiva-web-common | |
parent | 523213b737713663c7706cc6465eaa93c117214f (diff) | |
download | archiva-09208ec81a34875ce2f013f158de4879f024e222.tar.gz archiva-09208ec81a34875ce2f013f158de4879f024e222.zip |
simplify code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-web-common')
-rw-r--r-- | archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java index e601643fc..527b3a1de 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java @@ -42,7 +42,7 @@ import java.util.Map; * @author Olivier Lamy * @since 1.4-M4 */ -@Service( "userManager#archiva" ) +@Service("userManager#archiva") public class ArchivaConfigurableUsersManager extends ConfigurableUserManager { @@ -58,7 +58,7 @@ public class ArchivaConfigurableUsersManager private List<UserManagerListener> listeners = new ArrayList<UserManagerListener>(); @Inject - @Named( value = "cache#users" ) + @Named(value = "cache#users") private Cache usersCache; @Override @@ -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 |