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:43:45 UTC

[2/2] git commit: WICKET-4645 Merge two 'if's into one

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/ba9aba83
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ba9aba83
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ba9aba83

Branch: refs/heads/wicket-1.5.x
Commit: ba9aba83767e1d2e067986eb6ab172c9329f1248
Parents: 81eee3c
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:43:38 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/ba9aba83/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 8001c63..c3fc07e 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
@@ -292,15 +292,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);
 				}
 			}