diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java index 22007b6e8567..c7dc014b84e3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RequestPredicates.java @@ -51,6 +51,7 @@ import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; import org.springframework.util.MimeTypeUtils; import org.springframework.util.MultiValueMap; import org.springframework.validation.BindException; @@ -324,7 +325,7 @@ private static Map mergeMaps(Map left, Map right) { return left; } else { - Map result = new LinkedHashMap<>(left.size() + right.size()); + Map result = CollectionUtils.newLinkedHashMap(left.size() + right.size()); result.putAll(left); result.putAll(right); return result;