archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1425055 - /archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
Date Fri, 21 Dec 2012 17:54:37 GMT
Author: olamy
Date: Fri Dec 21 17:54:37 2012
New Revision: 1425055

URL: http://svn.apache.org/viewvc?rev=1425055&view=rev
Log:
simplify code

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java?rev=1425055&r1=1425054&r2=1425055&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java
Fri Dec 21 17:54:37 2012
@@ -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 ArchivaConfigurableUsersMan
     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 ArchivaConfigurableUsersMan
     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



Mime
View raw message