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 2008/12/23 19:58:14 UTC
svn commit: r729064 - in /wicket/trunk/wicket/src:
main/java/org/apache/wicket/MarkupContainer.java
main/java/org/apache/wicket/markup/MarkupCache.java
test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java
Author: jdonnerstag
Date: Tue Dec 23 10:58:14 2008
New Revision: 729064
URL: http://svn.apache.org/viewvc?rev=729064&view=rev
Log:
MarkupCache throws MarkupNotFoundException which MarkupContainer caught just to throw new MarkupNotFoundException. Changed MarkupContainer to simply pass MarkupNotFoundExceptions.
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java?rev=729064&r1=729063&r2=729064&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java Tue Dec 23 10:58:14 2008
@@ -357,6 +357,12 @@
// required.
throw ex;
}
+ catch (MarkupNotFoundException ex)
+ {
+ // re-throw it. The exception contains already all the information
+ // required.
+ throw ex;
+ }
catch (WicketRuntimeException ex)
{
// throw exception since there is no associated markup
@@ -1636,13 +1642,7 @@
Component component = (Component)child;
component.detach();
- if (child instanceof IComponentSourceProvider)
- {
- ComponentSourceEntry entry = new ComponentSourceEntry(this, component,
- ((IComponentSourceProvider)child).getComponentSource());
- children_set(i, entry, false);
- }
- else if (component.isAuto())
+ if (component.isAuto())
{
children_remove(i);
}
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java?rev=729064&r1=729063&r2=729064&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MarkupCache.java Tue Dec 23 10:58:14 2008
@@ -223,9 +223,14 @@
if (throwException == true)
{
// throw exception since there is no associated markup
- throw new MarkupNotFoundException("Markup not found. Component class: " +
- container.getClass().getName() +
- " Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried");
+ throw new MarkupNotFoundException(
+ "Markup of type '" +
+ container.getMarkupType() +
+ "' for component '" +
+ getClass().getName() +
+ "' not found." +
+ " Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: " +
+ container.toString());
}
return null;
Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java?rev=729064&r1=729063&r2=729064&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java Tue Dec 23 10:58:14 2008
@@ -16,7 +16,6 @@
*/
package org.apache.wicket.markup.html.basic;
-import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.WicketTestCase;
import org.apache.wicket.markup.MarkupException;
import org.apache.wicket.markup.MarkupNotFoundException;
@@ -313,12 +312,9 @@
{
executeTest(SimplePage_5.class, "SimplePageExpectedResult_5.html");
}
- catch (WicketRuntimeException ex)
+ catch (MarkupNotFoundException ex)
{
- if ((ex.getCause() != null) && (ex.getCause() instanceof MarkupNotFoundException))
- {
- hit = true;
- }
+ hit = true;
}
assertTrue("Did expect a MarkupNotFoundException", hit);
}