Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50448
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 10 Dec 2010 13:54:16 +0000 (13:54 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 10 Dec 2010 13:54:16 +0000 (13:54 +0000)
Regression caused by http://svn.apache.org/viewvc?view=revision&revision=1036281

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1044359 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/Session.java
java/org/apache/catalina/manager/DummyProxySession.java
java/org/apache/catalina/session/ManagerBase.java
java/org/apache/catalina/session/StandardSession.java
webapps/docs/changelog.xml

index 3299114..eed50ba 100644 (file)
@@ -90,6 +90,13 @@ public interface Session {
 
 
     /**
+     * Return the creation time for this session, bypassing the session validity
+     * checks.
+     */
+    public long getCreationTimeInternal();
+
+
+    /**
      * Set the creation time for this session.  This method is called by the
      * Manager when an existing Session instance is reused.
      *
index 54724bf..3bd7bac 100644 (file)
@@ -64,6 +64,11 @@ public class DummyProxySession implements Session {
     }
 
     @Override
+    public long getCreationTimeInternal() {
+        return 0;
+    }
+
+    @Override
     public String getId() {
         return sessionId;
     }
index 2ad2079..0d0eaaf 100644 (file)
@@ -799,7 +799,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase
         // the manager because it is being persisted - update the expired stats
         if (update) {
             long timeNow = System.currentTimeMillis();
-            int timeAlive = (int) ((timeNow - session.getCreationTime())/1000);
+            int timeAlive =
+                (int) (timeNow - session.getCreationTimeInternal())/1000;
             updateSessionMaxAliveTime(timeAlive);
             expiredSessions.incrementAndGet();
             SessionTiming timing = new SessionTiming(timeNow, timeAlive);
index 2c3227f..641370e 100644 (file)
@@ -1102,6 +1102,16 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
+     * Return the time when this session was created, in milliseconds since
+     * midnight, January 1, 1970 GMT, bypassing the session validation checks.
+     */
+    @Override
+    public long getCreationTimeInternal() {
+        return this.creationTime;
+    }
+
+
+    /**
      * Return the ServletContext to which this session belongs.
      */
     @Override
index e483365..038b878 100644 (file)
         <bug>50413</bug>: Ensure 304 responses are not returned when using
         static files as error pages. (markt)
       </fix>
+      <fix>
+        <bug>50448</bug>: Fix possible <code>IllegalStateException</code>
+        caused by recent session management refactoring. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">