Add an early exit to `StringUtils.cleanPath` to save array creating and
string concatenation. With a typical Spring application, the `cleanPath`
method can be called over 600 times, often with a path constructed by
a `ClassPathResource` that is likely to already be clean.
Closes gh-22568
Update `ConcurrentReferenceHashMap` to make some methods more inline
friendly, and to manually inline a few others. These minor optimizations
don't make a great deal of difference for most applications, but seem
worthwhile since we use `ConcurrentReferenceHashMap` for many internal
caches.
Closes gh-22566
Update `ConfigurationClassParser` to skip `java.lang.annotation` types
which were often processed but would never provide useful results. Also
use a single shared immutable `SourceClass` instance to represent
`Object.class`.
Closes gh-22563
Migrate all possible `AnnotationUtils` and `AnnotatedElementUtils`
method to the `MergedAnnotation` API, verify results against the old
implementations.
All migrated methods now call both the new API and the old version and
ensure that the same results or exceptions are raised. A full build of
both Spring Framework and Spring Boot has been executed to ensure, as
much as possible, that the migration does not cause unexpected
regressions.
See gh-22562
Create internal variants of the existing `AnnotationUtils` and
`AnnotatedElementUtils` classes and migrate the existing classes to
use them.
The internal variants will be used to check that the same results are
given as we migrate the utils methods to use the new `MergedAnnotations`
API.
See gh-22562
Add new `MergedAnnotations` and `MergedAnnotation` interfaces that
attempt to provide a uniform way for dealing with merged annotations.
Specifically, the new API provides alternatives for the static methods
in `AnnotationUtils` and `AnnotatedElementUtils` and supports Spring's
comprehensive annotation attribute `@AliasFor` features. The interfaces
also open the possibility of the same API being exposed from the
`AnnotationMetadata` interface.
Additional utility classes for collecting, filtering and selecting
annotations have also been added.
Typical usage for the new API would be something like:
MergedAnnotations.from(Example.class)
.stream(MyAnnotation.class)
.map(a -> a.getString("value"))
.forEach(System.out::println);
Closes gh-21697
Add a new test class to help cover annotation introspection failure
handling. These tests were previously missing and are important to
ensure that annotation util code changes don't introduce regressions.
See gh-21697
Add a public variant of `getDeclaredMethods` that defensively copies the
cached methods array. This is often more faster and more convenient
for users than calling `doWithLocalMethods`. We still retain most of the
benefits of the cache, namely fewer security manager calls and not as
many `Method` instances being created.
Closes gh-22580
As recommended by RFC 7231, this commit restore using 2 digit days
when formatting dates while still using
DateTimeFormatter.RFC_1123_DATE_TIME for parsing.
Closes gh-22478
This commit updates Jackson2ObjectMapperBuilder in order
to ensure that modules specified via modulesToInstall
eventually override the default ones.
Closes gh-22576
This commit adds support for HandlerFunctions and RouterFunctions to
DispatcherServlet, in the form of a HandlerAdapter and HandlerMapping.
See gh-21490
This commit introduces Servlet.fn, a servlet-based version of
WebFlux.fn, i.e. HandlerFunctions and RouterFunctions.
This commit contains the web framework only, further commits provide
tests and DispatcherServlet integration.
See gh-21490
Extend the list of disconnected client errors in HttpWebHandlerAdapter
to include the Reactor Netty AbortedException as well exceptions with
the message "connection reset by peer".
Closes gh-21790
Prior to this commit, documentation for WebJar support referenced the
webjars-locator artifact; however, Spring now uses the
webjars-locator-core artifact.
This commit updates the documentation to reflect this.
Closes gh-22613