You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/09/02 16:44:41 UTC
git commit: WICKET-4645 Merge two 'if's into one
Updated Branches:
refs/heads/master 7e1aa8653 -> 4f5cb035a
WICKET-4645 Merge two 'if's into one
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4f5cb035
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4f5cb035
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4f5cb035
Branch: refs/heads/master
Commit: 4f5cb035a1caf782c7319c20a3986d099350ef23
Parents: 7e1aa86
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Sun Sep 2 16:43:07 2012 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Sun Sep 2 16:44:01 2012 +0200
----------------------------------------------------------------------
.../org/apache/wicket/request/UrlRenderer.java | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/4f5cb035/wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java
----------------------------------------------------------------------
diff --git a/wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java b/wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java
index eee72f0..c9cac95 100644
--- a/wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java
+++ b/wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java
@@ -295,15 +295,12 @@ public class UrlRenderer
// try to remove context/filter path only if the Url starts with '/',
// i.e. has an empty segment in the beginning
String contextPath = request.getContextPath();
- if (contextPath != null)
+ if (contextPath != null && segments.isEmpty() == false)
{
- if (segments.isEmpty() == false)
+ if (contextPath.equals(UrlUtils.normalizePath(segments.get(0))))
{
- if (contextPath.equals(UrlUtils.normalizePath(segments.get(0))))
- {
- LOG.debug("Removing the context path '{}' from '{}'", contextPath, segments);
- segments.remove(0);
- }
+ LOG.debug("Removing the context path '{}' from '{}'", contextPath, segments);
+ segments.remove(0);
}
}