- Redo findSessions which was outdated (42530 claims concurrency problems that I...
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 May 2007 10:06:31 +0000 (10:06 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 May 2007 10:06:31 +0000 (10:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@542185 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/session/ManagerBase.java

index ced391a..7ec2fa6 100644 (file)
@@ -175,7 +175,7 @@ public abstract class ManagerBase implements Manager, MBeanRegistration {
      * The set of currently active Sessions for this Manager, keyed by
      * session identifier.
      */
-    protected Map sessions = new ConcurrentHashMap();
+    protected Map<String, Session> sessions = new ConcurrentHashMap<String, Session>();
 
     // Number of sessions created by this manager
     protected int sessionCounter=0;
@@ -870,12 +870,7 @@ public abstract class ManagerBase implements Manager, MBeanRegistration {
      */
     public Session[] findSessions() {
 
-        Session results[] = null;
-        synchronized (sessions) {
-            results = new Session[sessions.size()];
-            results = (Session[]) sessions.values().toArray(results);
-        }
-        return (results);
+        return sessions.values().toArray(new Session[0]);
 
     }