diff options
author | Matthew Tambara | 2016-06-28 23:27:48 +0000 |
---|---|---|
committer | Matthew Tambara | 2016-06-28 23:27:48 +0000 |
commit | 6c8a30151d5b3e718787f94405659060cdca9645 (patch) | |
tree | 6ab7d5c2d6cfad2fbe1607f948ae4e8771dfab34 | |
parent | 9a21542a26e810ee12254edcdb5b173fad8198ef (diff) | |
download | rt.equinox.bundles-6c8a30151d5b3e718787f94405659060cdca9645.tar.gz rt.equinox.bundles-6c8a30151d5b3e718787f94405659060cdca9645.tar.xz rt.equinox.bundles-6c8a30151d5b3e718787f94405659060cdca9645.zip |
LPS-66881 Remove duplicate getAttribute() calls
Signed-off-by: Matthew Tambara <matthew.tambara@liferay.com>
-rw-r--r-- | bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpServletRequestWrapperImpl.java | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpServletRequestWrapperImpl.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpServletRequestWrapperImpl.java index 98c2086fd..0bd2e1bf7 100644 --- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpServletRequestWrapperImpl.java +++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpServletRequestWrapperImpl.java @@ -170,45 +170,65 @@ public class HttpServletRequestWrapperImpl extends HttpServletRequestWrapper { if (hasServletName) { return null; } - if (super.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH) != null) { - return super.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH); + + Object attributeValue = super.getAttribute(attributeName); + + if (attributeValue != null) { + return attributeValue; } + return current.getContextController().getContextPath(); } else if (attributeName.equals(RequestDispatcher.INCLUDE_PATH_INFO)) { if (hasServletName) { return null; } - if (super.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO) != null) { - return super.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO); + + Object attributeValue = super.getAttribute(attributeName); + + if (attributeValue != null) { + return attributeValue; } + return current.getPathInfo(); } else if (attributeName.equals(RequestDispatcher.INCLUDE_QUERY_STRING)) { if (hasServletName) { return null; } - if (super.getAttribute(RequestDispatcher.INCLUDE_QUERY_STRING) != null) { - return super.getAttribute(RequestDispatcher.INCLUDE_QUERY_STRING); + + Object attributeValue = super.getAttribute(attributeName); + + if (attributeValue != null) { + return attributeValue; } + return current.getQueryString(); } else if (attributeName.equals(RequestDispatcher.INCLUDE_REQUEST_URI)) { if (hasServletName) { return null; } - if (super.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI) != null) { - return super.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI); + + Object attributeValue = super.getAttribute(attributeName); + + if (attributeValue != null) { + return attributeValue; } + return current.getRequestURI(); } else if (attributeName.equals(RequestDispatcher.INCLUDE_SERVLET_PATH)) { if (hasServletName) { return null; } - if (super.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH) != null) { - return super.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH); + + Object attributeValue = super.getAttribute(attributeName); + + if (attributeValue != null) { + return attributeValue; } + return current.getServletPath(); } |