diff options
author | shuyangzhou | 2016-06-29 17:26:38 +0000 |
---|---|---|
committer | shuyangzhou | 2016-06-29 17:26:38 +0000 |
commit | ce3111a7b770eba4ce52ac0263b8efa85c99e427 (patch) | |
tree | 253cab7ddfa0a64fd2447b2bb35e5e08ea5b5fd2 | |
parent | 6c8a30151d5b3e718787f94405659060cdca9645 (diff) | |
download | rt.equinox.bundles-ce3111a7b770eba4ce52ac0263b8efa85c99e427.tar.gz rt.equinox.bundles-ce3111a7b770eba4ce52ac0263b8efa85c99e427.tar.xz rt.equinox.bundles-ce3111a7b770eba4ce52ac0263b8efa85c99e427.zip |
LPS-66903 In normal execution paths, DispatchTargets.toString() is never used, let's defer the toString value calculation when it is really needed.
Signed-off-by: shuyangzhou <shuyang.zhou@liferay.com>
-rw-r--r-- | bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java index b79aae2a9..3e49b56c8 100644 --- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java +++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java @@ -53,8 +53,6 @@ public class DispatchTargets { this.servletPath = (servletPath == null) ? Const.BLANK : servletPath; this.pathInfo = pathInfo; this.queryString = queryString; - - this.string = SIMPLE_NAME + '[' + contextController.getFullContextPath() + requestURI + (queryString != null ? '?' + queryString : "") + ", " + endpointRegistration.toString() + ']'; //$NON-NLS-1$ } public void addRequestParameters(HttpServletRequest request) { @@ -183,7 +181,15 @@ public class DispatchTargets { @Override public String toString() { - return string; + String value = string; + + if (value == null) { + value = SIMPLE_NAME + '[' + contextController.getFullContextPath() + requestURI + (queryString != null ? '?' + queryString : "") + ", " + endpointRegistration.toString() + ']'; //$NON-NLS-1$ + + string = value; + } + + return value; } private static Map<String, String[]> queryStringToParameterMap(String queryString) { @@ -252,6 +258,6 @@ public class DispatchTargets { private final String requestURI; private final String servletPath; private final String servletName; - private final String string; + private String string; }
\ No newline at end of file |