Updated Branches: refs/heads/master ac2d03964 -> f9b120886
Minor improvements: - typos in javadoc and error messages - broken links in javadoc - close streams Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f9b12088 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f9b12088 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f9b12088 Branch: refs/heads/master Commit: f9b1208869cda28a457522433297a91b924d5026 Parents: 555ea17 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Mon Feb 6 17:37:59 2012 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Mon Feb 6 17:37:59 2012 +0200 ---------------------------------------------------------------------- .../java/org/apache/wicket/markup/MarkupCache.java | 8 ++-- .../org/apache/wicket/markup/MarkupFactory.java | 2 +- .../org/apache/wicket/pageStore/DiskDataStore.java | 43 +++++++++------ .../resource/locator/IResourceStreamLocator.java | 2 +- 4 files changed, 32 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/f9b12088/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java b/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java index 43a7cac..1e3101d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java @@ -127,7 +127,7 @@ public class MarkupCache implements IMarkupCache if (log.isDebugEnabled()) { - log.debug("Remove from cache: " + cacheKey); + log.debug("Removing from cache: " + cacheKey); } // Remove the markup from the cache @@ -147,7 +147,7 @@ public class MarkupCache implements IMarkupCache log.debug("Removed from cache: " + locationString); } - // If a base markup file has been removed from the cache, than + // If a base markup file has been removed from the cache then // the derived markup should be removed as well. removeMarkupWhereBaseMarkupIsNoLongerInTheCache(); @@ -341,7 +341,7 @@ public class MarkupCache implements IMarkupCache log.debug("Markup not found: " + cacheKey); } - // If cacheKey == null, than caching is disabled for the component + // If cacheKey == null then caching is disabled for the component if (cacheKey != null) { // flag markup as non-existent @@ -464,7 +464,7 @@ public class MarkupCache implements IMarkupCache return markup; } - // In case the markup could not be loaded (without exception), than .. + // In case the markup could not be loaded (without exception) then .. if (cacheKey != null) { removeMarkup(cacheKey); http://git-wip-us.apache.org/repos/asf/wicket/blob/f9b12088/wicket-core/src/main/java/org/apache/wicket/markup/MarkupFactory.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/MarkupFactory.java b/wicket-core/src/main/java/org/apache/wicket/markup/MarkupFactory.java index 72e7026..b5be533 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/MarkupFactory.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/MarkupFactory.java @@ -435,7 +435,7 @@ public class MarkupFactory log.error("Error while reading the markup " + markupResourceStream, e); // Wrap with wicket exception and re-throw - throw new MarkupException(markupResourceStream, "IO error while readin markup: " + + throw new MarkupException(markupResourceStream, "IO error while reading markup: " + e.getMessage(), e); } catch (WicketRuntimeException e) http://git-wip-us.apache.org/repos/asf/wicket/blob/f9b12088/wicket-core/src/main/java/org/apache/wicket/pageStore/DiskDataStore.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/DiskDataStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/DiskDataStore.java index 76f5171..401144d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/pageStore/DiskDataStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/DiskDataStore.java @@ -67,7 +67,6 @@ public class DiskDataStore implements IDataStore * @param applicationName * @param fileStoreFolder * @param maxSizePerSession - * @param fileChannelPoolCapacity */ public DiskDataStore(final String applicationName, final File fileStoreFolder, final Bytes maxSizePerSession) @@ -215,17 +214,22 @@ public class DiskDataStore implements IDataStore { InputStream stream = new FileInputStream(index); ObjectInputStream ois = new ObjectInputStream(stream); - Map<String, SessionEntry> map = (Map<String, SessionEntry>)ois.readObject(); - sessionEntryMap.clear(); - sessionEntryMap.putAll(map); - - for (Entry<String, SessionEntry> entry : sessionEntryMap.entrySet()) + try { - // initialize the diskPageStore reference - SessionEntry sessionEntry = entry.getValue(); - sessionEntry.diskDataStore = this; + Map<String, SessionEntry> map = (Map<String, SessionEntry>)ois.readObject(); + sessionEntryMap.clear(); + sessionEntryMap.putAll(map); + + for (Entry<String, SessionEntry> entry : sessionEntryMap.entrySet()) + { + // initialize the diskPageStore reference + SessionEntry sessionEntry = entry.getValue(); + sessionEntry.diskDataStore = this; + } + } finally { + stream.close(); + ois.close(); } - stream.close(); } catch (Exception e) { @@ -249,17 +253,22 @@ public class DiskDataStore implements IDataStore { OutputStream stream = new FileOutputStream(index); ObjectOutputStream oos = new ObjectOutputStream(stream); - Map<String, SessionEntry> map = new HashMap<String, SessionEntry>( - sessionEntryMap.size()); - for (Entry<String, SessionEntry> e : sessionEntryMap.entrySet()) + try { - if (e.getValue().unbound == false) + Map<String, SessionEntry> map = new HashMap<String, SessionEntry>( + sessionEntryMap.size()); + for (Entry<String, SessionEntry> e : sessionEntryMap.entrySet()) { - map.put(e.getKey(), e.getValue()); + if (e.getValue().unbound == false) + { + map.put(e.getKey(), e.getValue()); + } } + oos.writeObject(map); + } finally { + stream.close(); + oos.close(); } - oos.writeObject(map); - stream.close(); } catch (Exception e) { http://git-wip-us.apache.org/repos/asf/wicket/blob/f9b12088/wicket-core/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java b/wicket-core/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java index fb1287a..76120c9 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java @@ -32,7 +32,7 @@ public interface IResourceStreamLocator * Locate a resource, given a path and class. Typically this method is either called by external * clients if they are not interested in a lookup that takes the style and locale into account, * or it is called by the implementation of - * {@link #locate(Class, String, String, Locale, String)} where the latter just takes care of + * {@link #locate(Class, String, String, String, java.util.Locale, String, boolean)} where the latter just takes care of * trying out the different combinations for the provided style and locale and uses this method * to actually load the resource stream. *
