Previously, TomcatEmbeddedWebappClassLoader would find resources
in WEB-INF/classes. However, unlike standalone Tomcat, we know that in
a Boot app WEB-INF/classes is on the class path of the parent class
loader so the resources will be found when the parent is queried
(which happens as part of the normal search algortithm for both
getResource(String) and getResources(String)).
This commit overrides findResource(String) and findResources(String)
to return null and an empty enumeration respectively. This prevents
TomcatEmbeddedWebappClassLoader from finding resources in
WEB-INF/classes and returning war: URLs for them that duplicate the
jar: URLs that will be found when the parent is queried.
Closes gh-9014
Previously, if a name contained part of a regex but wasn't actually
a regex, a PatternSyntaxException would be thrown and the request
would fail.
This commit updates NamePatternFilter to catch PatternSyntaxException
and treat the regex-like input as a name insteead.
See gh-9730
Previously, JsonContentAssert returns AbstractMapAssert from
extractingJsonPathMapValue. This could lead to type safety warnings
when calling one of the assert's methods with a generic varargs
parameter such as
contains(Entry<? extends Object, ? extends Object>...).
This commit replaces the use of both AbstractMapAssert and
AbstractListAssert with MapAssert and ListAssert respectively. These
classes use final methods and @SafeVargs args to prevent the
above-described problem from occurring.
See gh-9675
Previously, if a user's configuration class provided a custom
Validator bean, that configuration class would be initialized very
early so that the Validator could be used to create the
auto-configured MethodValidationPostProcessor. This early
initialization could problems as it may prevent any of the
configuration class's dependencies from being post-processed.
This commit updates the injection of the Validator bean to be lazy,
thereby preventing the creation of the auto-configured
MethodValidationPostProcessor from triggering early initialization.
Closes gh-9416