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 2006/10/15 03:46:54 UTC
svn commit: r464095 -
/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Session.java
Author: jcompagner
Date: Sat Oct 14 18:46:54 2006
New Revision: 464095
URL: http://svn.apache.org/viewvc?view=rev&rev=464095
Log:
transient field must be re tested!
Modified:
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Session.java
Modified: incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Session.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Session.java?view=diff&rev=464095&r1=464094&r2=464095
==============================================================================
--- incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Session.java (original)
+++ incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Session.java Sat Oct 14 18:46:54 2006
@@ -168,7 +168,7 @@
/** feedback messages */
private FeedbackMessages feedbackMessages = new FeedbackMessages(new CopyOnWriteArrayList());
- private transient Map pageMapsUsedInRequest = new HashMap(3);
+ private transient Map pageMapsUsedInRequest;
/** cached id because you can't access the id after session unbound */
private String id = null;
@@ -401,6 +401,13 @@
PageMap pageMap = pageMapForName(pageMapName, pageMapName == PageMap.DEFAULT_NAME);
if (pageMap != null)
{
+ synchronized (usedPageMaps) // get a lock so be sure that only one is made
+ {
+ if(pageMapsUsedInRequest == null)
+ {
+ pageMapsUsedInRequest = new HashMap(3);
+ }
+ }
synchronized (pageMapsUsedInRequest)
{
long startTime = System.currentTimeMillis();
@@ -1034,19 +1041,22 @@
*/
final void requestDetached()
{
- synchronized(pageMapsUsedInRequest)
+ if(pageMapsUsedInRequest != null)
{
- Thread t = Thread.currentThread();
- Iterator it = pageMapsUsedInRequest.entrySet().iterator();
- while(it.hasNext())
+ synchronized(pageMapsUsedInRequest)
{
- Entry entry = (Entry)it.next();
- if(entry.getValue() == t)
+ Thread t = Thread.currentThread();
+ Iterator it = pageMapsUsedInRequest.entrySet().iterator();
+ while(it.hasNext())
{
- it.remove();
+ Entry entry = (Entry)it.next();
+ if(entry.getValue() == t)
+ {
+ it.remove();
+ }
}
+ pageMapsUsedInRequest.notifyAll();
}
- pageMapsUsedInRequest.notifyAll();
}
}