From 487e14d549876e93830fca72964773e95aaf4dd2 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 30 Jul 2018 23:30:36 +0200 Subject: [PATCH] Polishing --- .../mvc/support/DefaultHandlerExceptionResolver.java | 12 +++++------- .../tags/form/AbstractSingleCheckedElementTag.java | 9 ++++----- .../web/servlet/tags/form/InputTag.java | 2 +- .../web/servlet/tags/form/TextareaTag.java | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java index ea554df33b..627681e7a5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java @@ -227,15 +227,13 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes return handleAsyncRequestTimeoutException( (AsyncRequestTimeoutException) ex, request, response, handler); } - else { - return null; - } - } catch (Exception handlerEx) { - logger.warn("Failure while trying to resolve exception [" + ex.getClass().getName() + "]", handlerEx); - return null; + if (logger.isWarnEnabled()) { + logger.warn("Failure while trying to resolve exception [" + ex.getClass().getName() + "]", handlerEx); + } } + return null; } /** @@ -543,7 +541,7 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes if (!response.isCommitted()) { response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } - else if (logger.isWarnEnabled()) { + else { logger.warn("Async request timed out"); } return new ModelAndView(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java index 23493c33e7..4bbcfbb411 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,9 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** - * Abstract base class to provide common methods for implementing - * databinding-aware JSP tags for rendering a single - * HTML '{@code input}' element with a '{@code type}' - * of '{@code checkbox}' or '{@code radio}'. + * Abstract base class to provide common methods for implementing databinding-aware + * JSP tags for rendering a single HTML '{@code input}' element with a + * '{@code type}' of '{@code checkbox}' or '{@code radio}'. * * @author Juergen Hoeller * @since 2.5.2 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java index 2719a61429..e9f2bf1821 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java @@ -381,7 +381,7 @@ public class InputTag extends AbstractHtmlInputElementTag { String type = null; Map attributes = getDynamicAttributes(); if (attributes != null) { - type = (String) getDynamicAttributes().get("type"); + type = (String) attributes.get("type"); } if (type == null) { type = getType(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java index 189b6bf853..e0ce6e02ad 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.