Author: knopp Date: Sun Jan 6 19:15:30 2008 New Revision: 609496 URL: http://svn.apache.org/viewvc?rev=609496&view=rev Log: don't put the wrong page instance to pages threadlocal (this is a cleanup only, shouldn't really change anything).
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/AbstractPageStore.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/AbstractPageStore.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/AbstractPageStore.java?rev=609496&r1=609495&r2=609496&view=diff ============================================================================== --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/AbstractPageStore.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/pagestore/AbstractPageStore.java Sun Jan 6 19:15:30 2008 @@ -67,7 +67,7 @@ * @param data */ public SerializedPage(int pageId, String pageMapName, int versionNumber, - int ajaxVersionNumber, byte[] data) + int ajaxVersionNumber, byte[] data) { this.pageId = pageId; this.pageMapName = pageMapName; @@ -83,10 +83,10 @@ */ public SerializedPage(Page page) { - this.pageId = page.getNumericId(); - this.pageMapName = page.getPageMapName(); - this.versionNumber = page.getCurrentVersionNumber(); - this.ajaxVersionNumber = page.getAjaxVersionNumber(); + pageId = page.getNumericId(); + pageMapName = page.getPageMapName(); + versionNumber = page.getCurrentVersionNumber(); + ajaxVersionNumber = page.getAjaxVersionNumber(); } /** @@ -140,7 +140,7 @@ public int hashCode() { return pageId * 1931 + versionNumber * 13 + ajaxVersionNumber * 301 + - (pageMapName != null ? pageMapName.hashCode() : 0); + (pageMapName != null ? pageMapName.hashCode() : 0); } public boolean equals(Object obj) @@ -154,9 +154,8 @@ SerializedPage rhs = (SerializedPage)obj; return pageId == rhs.pageId && - (pageMapName == rhs.pageMapName || (pageMapName != null && pageMapName - .equals(rhs.pageMapName))) && versionNumber == rhs.versionNumber && - ajaxVersionNumber == rhs.ajaxVersionNumber; + (pageMapName == rhs.pageMapName || (pageMapName != null && pageMapName.equals(rhs.pageMapName))) && + versionNumber == rhs.versionNumber && ajaxVersionNumber == rhs.ajaxVersionNumber; } }; @@ -256,8 +255,8 @@ { private SerializedPage current; - private List previous = new ArrayList(); - private List completed = new ArrayList(); + private final List previous = new ArrayList(); + private final List completed = new ArrayList(); protected void onPageSerialized(SerializedPage page) @@ -272,7 +271,7 @@ */ public PageSerializer(SerializedPage page) { - this.current = page; + current = page; } /** @@ -304,7 +303,7 @@ } public Page deserializePage(int id, String pageMapName, Page page, ObjectInputStream stream) - throws IOException, ClassNotFoundException + throws IOException, ClassNotFoundException { HashMap pageMaps = (HashMap)SecondLevelCacheSessionStore.getUsedPages().get(); if (pageMaps == null) @@ -318,18 +317,18 @@ pages = new IntHashMap(); pageMaps.put(pageMapName, pages); } - pages.put(id, page); boolean b = stream.readBoolean(); if (b == false) { stream.defaultReadObject(); - return page; } else { // the object will resolve to a Page (probably PageHolder) - return (Page)stream.readObject(); + page = (Page)stream.readObject(); } + pages.put(id, page); + return page; } } @@ -346,8 +345,8 @@ PageHolder(Page page) { - this.pageid = page.getNumericId(); - this.pagemap = page.getPageMapName(); + pageid = page.getNumericId(); + pagemap = page.getPageMapName(); } protected Object readResolve() throws ObjectStreamException