jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r330056 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
Date Tue, 01 Nov 2005 13:50:45 GMT
Author: stefan
Date: Tue Nov  1 05:50:41 2005
New Revision: 330056

URL: http://svn.apache.org/viewcvs?rev=330056&view=rev
Log:
cleaner code

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=330056&r1=330055&r2=330056&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java Tue
Nov  1 05:50:41 2005
@@ -715,19 +715,9 @@
         }
 
         // close active user sessions
-        // (copy sessions to array to avoid ConcurrentModificationException)
-        int cnt = 0;
-        SessionImpl[] sa = new SessionImpl[activeSessions.size()];
-        for (Iterator it = activeSessions.values().iterator(); it.hasNext(); cnt++) {
-            sa[cnt] = (SessionImpl) it.next();
-        }
-        for (int i = 0; i < sa.length; i++) {
-            if (sa[i] != null) {
-                sa[i].removeListener(this);
-                sa[i].logout();
-            }
-        }
-        activeSessions.clear();
+        while (!activeSessions.isEmpty()) {
+           ((Session) activeSessions.values().iterator().next()).logout();
+       }
 
         // shut down workspaces
         for (Iterator it = wspInfos.values().iterator(); it.hasNext();) {



Mime
View raw message