Repository: wicket Updated Branches: refs/heads/master 67134a089 -> 56fe3592e
Print the processes markup when an error with opening/closing tag is detected for easier debugging. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8640ad2b Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8640ad2b Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8640ad2b Branch: refs/heads/master Commit: 8640ad2b8580dd51266a8f9f8e16d88ac3d72b73 Parents: 67134a0 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Tue Feb 25 14:07:28 2014 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Tue Feb 25 14:07:28 2014 +0200 ---------------------------------------------------------------------- .../src/main/java/org/apache/wicket/DequeueContext.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/8640ad2b/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java b/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java index 2717e8c..eec4e24 100644 --- a/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java +++ b/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java @@ -175,7 +175,7 @@ public final class DequeueContext for (; index < markup.size(); index++) { if ((markup.get(index) instanceof ComponentTag) - && ((ComponentTag)markup.get(index)).closes(tag)) + && markup.get(index).closes(tag)) { found = true; break; @@ -184,7 +184,8 @@ public final class DequeueContext if (!found) { throw new IllegalStateException( - "Could not find close tag for tag: " + tag); + String.format("Could not find close tag for tag '%s' in markup: %s ", + tag, markup)); } } @@ -208,7 +209,8 @@ public final class DequeueContext continue; case SKIP : throw new IllegalStateException( - "Should not see closed tag of skipped open tag: " + tag); + String.format("Should not see closed tag of skipped open tag '%s' in markup:%s", + tag, markup)); } } } @@ -220,13 +222,13 @@ public final class DequeueContext { Args.notNull(open, "open"); - DequeueTagAction action = null; - if (containers.size() < 1) { // TODO queueing message: called too early throw new IllegalStateException(); } + + DequeueTagAction action; for (int i = containers.size() - 1; i >= 0; i--) { action = containers.get(i).canDequeueTag((open));
