From 76ebb759f3d0e3edcc4ac5e81b9b1ac5878ae5bd Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Tue, 8 Jun 2010 22:56:59 +0100 Subject: [PATCH] Removed unnecessary casts. --- .../LoginUrlAuthenticationEntryPoint.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/authentication/LoginUrlAuthenticationEntryPoint.java b/web/src/main/java/org/springframework/security/web/authentication/LoginUrlAuthenticationEntryPoint.java index f8c4b03fe3..fd00025c7b 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/LoginUrlAuthenticationEntryPoint.java +++ b/web/src/main/java/org/springframework/security/web/authentication/LoginUrlAuthenticationEntryPoint.java @@ -109,9 +109,6 @@ public class LoginUrlAuthenticationEntryPoint implements AuthenticationEntryPoin public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { - HttpServletRequest httpRequest = (HttpServletRequest) request; - HttpServletResponse httpResponse = (HttpServletResponse) response; - String redirectUrl = null; if (useForward) { @@ -119,17 +116,17 @@ public class LoginUrlAuthenticationEntryPoint implements AuthenticationEntryPoin if (forceHttps && "http".equals(request.getScheme())) { // First redirect the current request to HTTPS. // When that request is received, the forward to the login page will be used. - redirectUrl = buildHttpsRedirectUrlForRequest(httpRequest); + redirectUrl = buildHttpsRedirectUrlForRequest(request); } if (redirectUrl == null) { - String loginForm = determineUrlToUseForThisRequest(httpRequest, httpResponse, authException); + String loginForm = determineUrlToUseForThisRequest(request, response, authException); if (logger.isDebugEnabled()) { logger.debug("Server side forward to: " + loginForm); } - RequestDispatcher dispatcher = httpRequest.getRequestDispatcher(loginForm); + RequestDispatcher dispatcher = request.getRequestDispatcher(loginForm); dispatcher.forward(request, response); @@ -138,11 +135,11 @@ public class LoginUrlAuthenticationEntryPoint implements AuthenticationEntryPoin } else { // redirect to login page. Use https if forceHttps true - redirectUrl = buildRedirectUrlToLoginPage(httpRequest, httpResponse, authException); + redirectUrl = buildRedirectUrlToLoginPage(request, response, authException); } - redirectStrategy.sendRedirect(httpRequest, httpResponse, redirectUrl); + redirectStrategy.sendRedirect(request, response, redirectUrl); } protected String buildRedirectUrlToLoginPage(HttpServletRequest request, HttpServletResponse response,