You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2010/03/03 20:54:23 UTC
svn commit: r918667 - in
/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket:
markup/Markup.java markup/MarkupCache.java markup/MergedMarkup.java
util/resource/IFixedLocationResourceStream.java
Author: jdonnerstag
Date: Wed Mar 3 19:54:23 2010
New Revision: 918667
URL: http://svn.apache.org/viewvc?rev=918667&view=rev
Log:
fixed: MarkupCache messed up when using MergedMarkup (e.g. for Page markup inheritance) together with IResourceStreams that do NOT also implement IFixedLocationResourceStream
Issue: WICKET-2764
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/Markup.java
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/util/resource/IFixedLocationResourceStream.java
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/Markup.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/Markup.java?rev=918667&r1=918666&r2=918667&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/Markup.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/Markup.java Wed Mar 3 19:54:23 2010
@@ -103,7 +103,7 @@
* MergedMarkup) to override their location, as they are composed of multiple Markups in
* different locations. SEE WICKET-1507 (Jeremy Thomerson)
*
- * @return the location of this markup
+ * @return the location of this markup. Return null to avoid caching the markup.
*/
public String locationAsString()
{
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java?rev=918667&r1=918666&r2=918667&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java Wed Mar 3 19:54:23 2010
@@ -459,6 +459,7 @@
// couldn't be resolved.
locationString = cacheKey;
}
+
try
{
Markup markup = getMarkupLoader().loadMarkup(container, markupResourceStream, null,
@@ -466,9 +467,10 @@
if (cacheKey != null)
{
- if (markup.locationAsString() != null)
+ String temp = markup.locationAsString();
+ if (temp != null)
{
- locationString = markup.locationAsString();
+ locationString = temp;
}
// add the markup to the cache.
markupKeyCache.put(cacheKey, locationString);
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java?rev=918667&r1=918666&r2=918667&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java Wed Mar 3 19:54:23 2010
@@ -94,6 +94,9 @@
}
}
+ /**
+ * @see org.apache.wicket.markup.Markup#locationAsString()
+ */
@Override
public String locationAsString()
{
@@ -102,8 +105,14 @@
* does, the location is unique to this combination (or vice versa) SEE WICKET-1507 (Jeremy
* Thomerson)
*/
- return getMarkupResourceData().getBaseMarkup().locationAsString() + ":" +
- getMarkupResourceData().getResource().locationAsString();
+ String l1 = getMarkupResourceData().getBaseMarkup().locationAsString();
+ String l2 = getMarkupResourceData().getResource().locationAsString();
+ if ((l1 == null) && (l2 == null))
+ {
+ return null;
+ }
+
+ return l1 + ":" + l2;
}
/**
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/util/resource/IFixedLocationResourceStream.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/util/resource/IFixedLocationResourceStream.java?rev=918667&r1=918666&r2=918667&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/util/resource/IFixedLocationResourceStream.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/util/resource/IFixedLocationResourceStream.java Wed Mar 3 19:54:23 2010
@@ -26,7 +26,8 @@
public interface IFixedLocationResourceStream
{
/**
- * @return The fixed location as a string, e.g. the file name or the URL
+ * @return The fixed location as a string, e.g. the file name or the URL. Return null to avoid
+ * caching the markup.
*/
String locationAsString();
}