From 48777367949134b5831cdb13c4dd62ad69e406f6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 12 Jun 2019 00:58:04 +0200 Subject: [PATCH] Polishing --- .../accept/MappingMediaTypeFileExtensionResolver.java | 2 +- .../web/context/request/async/WebAsyncManager.java | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java b/spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java index f6ec22df6e..806c4b0320 100644 --- a/spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java +++ b/spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java @@ -57,7 +57,7 @@ public class MappingMediaTypeFileExtensionResolver implements MediaTypeFileExten mediaTypes.forEach((extension, mediaType) -> { String lowerCaseExtension = extension.toLowerCase(Locale.ENGLISH); this.mediaTypes.put(lowerCaseExtension, mediaType); - addFileExtension(mediaType, extension); + addFileExtension(mediaType, lowerCaseExtension); allFileExtensions.add(lowerCaseExtension); }); this.allFileExtensions.addAll(allFileExtensions); diff --git a/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java b/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java index bf20dc472e..8b21aeb148 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java @@ -296,7 +296,9 @@ public final class WebAsyncManager { final CallableInterceptorChain interceptorChain = new CallableInterceptorChain(interceptors); this.asyncWebRequest.addTimeoutHandler(() -> { - logger.debug("Async request timeout for " + formatRequestUri()); + if (logger.isDebugEnabled()) { + logger.debug("Async request timeout for " + formatRequestUri()); + } Object result = interceptorChain.triggerAfterTimeout(this.asyncWebRequest, callable); if (result != CallableProcessingInterceptor.RESULT_NONE) { setConcurrentResultAndDispatch(result); @@ -304,7 +306,9 @@ public final class WebAsyncManager { }); this.asyncWebRequest.addErrorHandler(ex -> { - logger.debug("Async request error for " + formatRequestUri() + ": " + ex); + if (logger.isDebugEnabled()) { + logger.debug("Async request error for " + formatRequestUri() + ": " + ex); + } Object result = interceptorChain.triggerAfterError(this.asyncWebRequest, callable, ex); result = (result != CallableProcessingInterceptor.RESULT_NONE ? result : ex); setConcurrentResultAndDispatch(result); @@ -339,7 +343,6 @@ public final class WebAsyncManager { } } - @SuppressWarnings("ConstantConditions") private void logExecutorWarning() { if (taskExecutorWarning && logger.isWarnEnabled()) { synchronized (DEFAULT_TASK_EXECUTOR) {