Merge branch '5.1.x'

This commit is contained in:
Juergen Hoeller
2019-05-03 00:23:57 +02:00
12 changed files with 70 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 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.
@@ -64,8 +64,8 @@ public final class MediaTypeFactory {
* @return a multi-value map, mapping media types to file extensions.
*/
private static MultiValueMap<String, MediaType> parseMimeTypes() {
try (InputStream is = MediaTypeFactory.class.getResourceAsStream(MIME_TYPES_FILE_NAME)) {
BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.US_ASCII));
InputStream is = MediaTypeFactory.class.getResourceAsStream(MIME_TYPES_FILE_NAME);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.US_ASCII))) {
MultiValueMap<String, MediaType> result = new LinkedMultiValueMap<>();
String line;
while ((line = reader.readLine()) != null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 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.
@@ -81,7 +81,9 @@ public abstract class AbstractWebArgumentResolverAdapter implements HandlerMetho
}
catch (Exception ex) {
// ignore (see class-level doc)
logger.debug("Error in checking support for parameter [" + parameter + "], message: " + ex.getMessage());
if (logger.isDebugEnabled()) {
logger.debug("Error in checking support for parameter [" + parameter + "]: " + ex.getMessage());
}
return false;
}
}