Prior to this commit, exceptions thrown while closing an InputStream in
AbstractResource were silently ignored.
This commit improves diagnostics for such failure scenarios by logging
the exception at DEBUG level.
Closes gh-23116
This commit introduces support for consistent ordering of Properties
created by CollectionFactory.createStringAdaptingProperties().
Specifically, the created Properties instance sorts properties
alphanumerically based on their keys.
Closes gh-23081
This commit introduces an internal SortedProperties class that is a
specialization of java.util.Properties which sorts properties
alphanumerically based on their keys.
This can be useful when storing a java.util.Properties instance in a
properties file, since it allows such files to be generated in a
repeatable manner with consistent ordering of properties.
Comments in generated properties files can also be optionally omitted.
An instance of SortedProperties can be created via two new
createSortedProperties() factory methods in
org.springframework.core.CollectionFactory.
Closes gh-23018
Update `AnnotationTypeMapping` so that instance comparisons are no
longer used when checking attribute methods. Prior to this commit,
in an environment with tightly constrained memory, the method cache
could be cleared and different method instances would be returned.
Closes gh-23010
Rename some `MergedAnnotation` methods to prevent using parent/child
terminology, specifically:
`getDepth()` has been renamed `getDistance()`
`getParent()` has been renamed `getMetaSource()`
`getTypeHierarchy()` has been renamed `getMetaTypes()`
The parent child naming was particularly confusing given that the
parent/child relationships were inverted from the way that a lot of
users think about meta-annotations. For example, a `@RequestMapping`
having a parent of `@GetMapping` feels odd given that `@GetMapping`
is the thing declaring the meta-annotation relationship.
The new method names are designed to align more closely with existing
terms. For example, `getMetaSource` hints at the relationship with
`isMetaAnnotated` and `getSource`.
Closes gh-22946
Aligns ReactiveAdapterRegistry with MVC/messaging handler methods in terms of recognizing CompletionStage as well as CompletableFuture. Includes consistent use of ReactiveAdapter for reactive transactions.
Closes gh-23011
* Added DataBufferUtils.split variant that takes multiple delimiters
as argument (instead of 1).
* Use this new split() variant from within StringDecoder, replacing
its inefficient algorithm with the Knuth-Morris-Pratt algorithm.
Organize test imports to expand all '.*' static imports into
fully qualified imports.
This update will allow us to use additional checkstyle rules in
the future, and will also help if we migrate fully to AssertJ.
* Add limited checkstyles to test code
Add a limited set of checkstyle rules to the test codebase to improve
code consistency.
* Fix checksyle violations in test code
* Organize imports to fix checkstyle for test code
* Migrate to assertThatExceptionOfType
Migrate aware from ExpectedException rules to AssertJ exception
assertions. Also include a checkstyle rules to ensure that the
the ExpectedException is not accidentally used in the future.
See gh-22894
Deprecate the public `StandardMetadata` constructors to make it clearer
that these classes should not be instantiated directly. A new
`AnnotationMetadata.introspect` factory method has been added which
can now be used to obtain instances.
This change will allow use to make the constructors package private
and drop the `nestedAnnotationsAsMap` parameter in a future release.
Closes gh-22906
Replace the existing ASM based readers with new implementations that
also support MergedAnnotations. The meta-data classes themselves are
now immutable, and constructed via separate reader classes.
The `SimpleMetadataReader` class has been updated to return the new
classes, however the old ones remain since some of them are public
and might be being used directly.
Closes gh-22884
Add `AnnotatedTypeMetaData.getAnnotations()` that can be used to access
annotation details using the `MergedAnnotations` interface.
Where possible, the existing annotation methods have been migrated to
call `getAnnotation()`, rather than needing their own implementation.
The existing ASM based meta-data implementations have not been updated
since they will be deprecated and replaced in a subsequent commit.
See gh-22884