Prior to this commit, InstantFormatter was able to properly serialize
an Instant that is far in the future (or in the past), but it could not
properly deserialize it, because in such scenarios an ISO-formatted
Instant starts with a +/- sign.
This commit fixes this issue, while maintaining the previous contract,
and also introduces tests for InstantFormatter.
Closes gh-23895
Currently, if you have an optional event listener (via a @Bean method returning `null`)
this causes the event multicaster to explode violently. Now, we just safely skip it.
This commit refactors several tests to use SocketUtils to find an
available port, compose a custom JMX service URL using that port, and
start an MBeanServer for the particular test using that port.
This commit also makes other changes to MBeanServer related tests in an
effort to make them more robust when executed concurrently.
Closes gh-23699
Prior to this commit, the `DateFormatterRegistrar` would register the
annotation-based formatter before the pattern-based formatter. This
would create an issue when an application tries to convert a `String` to
an annotated `@DateTimeFormat Date`: since the converters are considered
in reversed order of registration in
`GenericConversionServicei#ConvertersForPair`, the pattern-based variant
would always be considered before the annotation-based variant,
overriding the developer's opinion.
This commit aligns the `DateFormatterRegistrar` with the
`DateTimeFormatterRegistrar` and registers the annotation-based variant
last.
Closes gh-23893
Commit 979508a7f3 removed the JUnit 4
dependency from all modules except spring-test. Unfortunately, the
@Inject TCK tests (SpringAtInjectTckTests) are still based on JUnit 3.
Thus, that commit accidentally excluded those tests from the build.
This commit includes SpringAtInjectTckTests in the build again by
introducing a test runtime dependency on the JUnit Vintage TestEngine
in spring-context.
See gh-23451
Prior to this commit, the name of the Thread registered via
ConfigurableApplicationContext#registerShutdownHook() was the generic,
default thread name ("Thread-#"). That made it difficult to discern
which executing thread was the Spring ApplicationContext shutdown hook.
This commit improves diagnostics by setting the thread name of the
ApplicationContext shutdown hook to "SpringContextShutdownHook".
Closes gh-23670
This commit removes the duplicated CRON_DISABLED constant value from
@Scheuled and simply refers to the ScheduledTaskRegistrar.CRON_DISABLED
constant.
This avoids a potential package cycle by ensuring that the `annotation`
package depends on the `config` package but not the other way around.
See gh-23568
Allow `ImportBeanDefinitionRegistrar`, `ImportSelector`,
`DeferredImportSelector.Group` and `TypeFilter` to use constructor
parameters as an alternative to `*Aware` callbacks.
In order to remain backwards compatible, injection only occurs
when there is a single constructor with one or more parameters.
The following parameter types are supported:
* `Environment`
* `BeanFactory`
* `ClassLoader`
* `ResourceLoader`
In order to keep the algorithm simple, subclass parameter types are
not supported. For example, you cannot use `ConfigurableEnvironment`
instead of `Environment`.
Closes gh-23637