From 7a42ff16acd787c4a5b7c01c36ef9c42b6039869 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 8 Sep 2010 22:53:39 +0000 Subject: [PATCH] polishing --- .../web/servlet/view/RedirectView.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/RedirectView.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/RedirectView.java index a98f6ea935..be918dd33a 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/RedirectView.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/RedirectView.java @@ -252,7 +252,7 @@ public class RedirectView extends AbstractUrlBasedView { boolean first = (getUrl().indexOf('?') < 0); for (Map.Entry entry : queryProperties(model).entrySet()) { Object rawValue = entry.getValue(); - Iterator valueIter = null; + Iterator valueIter; if (rawValue != null && rawValue.getClass().isArray()) { valueIter = Arrays.asList(ObjectUtils.toObjectArray(rawValue)).iterator(); } @@ -403,14 +403,18 @@ public class RedirectView extends AbstractUrlBasedView { /** * Determines the status code to use for HTTP 1.1 compatible requests. *

The default implemenetation returns the {@link #setStatusCode(HttpStatus) statusCode} - * property if set, or the value of the {@link #RESPONSE_STATUS_ATTRIBUTE} attribute. If neither are - * set, it defaults to {@link HttpStatus#SEE_OTHER} (303). + * property if set, or the value of the {@link #RESPONSE_STATUS_ATTRIBUTE} attribute. + * If neither are set, it defaults to {@link HttpStatus#SEE_OTHER} (303). * @param request the request to inspect - * @return the response + * @param response the servlet response + * @param targetUrl the target URL + * @return the response status */ - protected HttpStatus getHttp11StatusCode(HttpServletRequest request, HttpServletResponse response, String targetUrl) { - if (statusCode != null) { - return statusCode; + protected HttpStatus getHttp11StatusCode( + HttpServletRequest request, HttpServletResponse response, String targetUrl) { + + if (this.statusCode != null) { + return this.statusCode; } HttpStatus attributeStatusCode = (HttpStatus) request.getAttribute(View.RESPONSE_STATUS_ATTRIBUTE); if (attributeStatusCode != null) {