Author: ivaynberg
Date: Tue May 10 04:01:41 2011
New Revision: 1101305

URL: http://svn.apache.org/viewvc?rev=1101305&view=rev
Log:

Issue: WICKET-3668

Modified:
    
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java

Modified: 
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java?rev=1101305&r1=1101304&r2=1101305&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java
 Tue May 10 04:01:41 2011
@@ -810,6 +810,18 @@ public abstract class Session implements
                                list.add((IPageMap)getAttribute(attribute));
                        }
                }
+
+               // there is a small chance another thread removes the pagemap 
while we are iterating the
+               // attributes and we end up with null in our list
+               Iterator<IPageMap> maps = list.iterator();
+               while (maps.hasNext())
+               {
+                       if (maps.next() == null)
+                       {
+                               maps.remove();
+                       }
+               }
+
                Collections.sort(list, new LruComparator());
                return list;
        }


Reply via email to