You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2007/04/11 14:39:06 UTC
svn commit: r527474 -
/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
Author: jcompagner
Date: Wed Apr 11 05:39:03 2007
New Revision: 527474
URL: http://svn.apache.org/viewvc?view=rev&rev=527474
Log:
better testing for removing the threadlocals in session
Modified:
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java?view=diff&rev=527474&r1=527473&r2=527474
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java Wed Apr 11 05:39:03 2007
@@ -1166,15 +1166,15 @@
*/
protected void update()
{
- List lst = (List)touchedPages.get();
- if (lst != null)
+ List touchedPages = (List)Session.touchedPages.get();
+ Session.touchedPages.set(null);
+ if (touchedPages != null)
{
- for (int i = 0; i < lst.size(); i++)
+ for (int i = 0; i < touchedPages.size(); i++)
{
- Page page = (Page)lst.get(i);
+ Page page = (Page)touchedPages.get(i);
page.getPageMap().put(page);
}
- touchedPages.set(null);
}
// If state is dirty
@@ -1199,8 +1199,10 @@
}
}
- // Go through all dirty entries, replicating any dirty objects
List dirtyObjects = (List)Session.dirtyObjects.get();
+ Session.dirtyObjects.set(null);
+
+ // Go through all dirty entries, replicating any dirty objects
if (dirtyObjects != null)
{
for (final Iterator iterator = dirtyObjects.iterator(); iterator.hasNext();)
@@ -1232,7 +1234,6 @@
setAttribute(attribute, object);
}
- Session.dirtyObjects.set(null);
}
}
@@ -1304,6 +1305,20 @@
*/
final void requestDetached()
{
+ List touchedPages = (List)Session.touchedPages.get();
+ Session.touchedPages.set(null);
+ if (touchedPages != null && touchedPages.size() > 0)
+ {
+ log.warn("There where still touched pages in the request detach phase, session update wasn't called: " + touchedPages);
+ }
+
+ List dirtyObjects = (List)Session.dirtyObjects.get();
+ Session.dirtyObjects.set(null);
+ if (dirtyObjects != null && dirtyObjects.size() > 0)
+ {
+ log.warn("There where still dirty objects in the request detach phase, session update wasn't called: " + dirtyObjects);
+ }
+
if (pageMapsUsedInRequest != null)
{
synchronized (pageMapsUsedInRequest)