Commit Graph

2078 Commits

Author SHA1 Message Date
Brian Clozel 77a658f51b Fix registration of ApplicationStartupAware
Closes gh-26576
2021-02-23 11:45:53 +01:00
Sam Brannen db5be44ff4 Polishing 2021-02-22 17:02:17 +01:00
Sam Brannen 313e754a84 Support load-time weaving for @Component classes again
Since Spring Framework 5.2, the LoadTimeWeaver no longer weaves bean
classes annotated with @Component. This is a regression caused by the
changes in 40c62139ae, stemming from the fact that any class annotated
or meta-annotated with @Component is considered to be a candidate
configuration class in 'configuration lite' mode (i.e., a class without
the @Configuration annotation and without any @Bean methods) and
therefore now has its class eagerly loaded. This results in the class
being loaded before the LoadTimeWeaver has a chance to weave it.

This commit fixes this regression by explicitly avoiding eager class
loading for any 'lite' @Configuration or @Component class without @Bean
methods.

Closes gh-26199
2021-02-22 09:59:22 +01:00
Sam Brannen 207ee9e307 Polishing 2021-02-21 19:14:05 +01:00
Sam Brannen fd49c8f598 Polishing 2021-02-16 16:54:49 +01:00
Sébastien Deleuze 3524401bf1 Introduce a NativeDetector utility class
With the introduction of the -H:+InlineBeforeAnalysis native image
compiler flag in GraalVM 21.0.0, it is now possible to use an utility method and get code
removal at build time.

This flag will be enabled as of Spring Native 0.9.0.

closes gh-25795
2021-02-15 16:36:23 +01:00
Juergen Hoeller 3baa44c5ef Polishing 2021-02-14 18:53:53 +01:00
Juergen Hoeller df977a2fd2 Nullability refinements and related polishing 2021-02-14 17:57:32 +01:00
Juergen Hoeller defc2466b0 Fail early FactoryBean instantiation for LinkageError
Closes gh-26425
2021-02-14 17:56:38 +01:00
fengyuanwei a991c23db5 Close mapping streams after the ValidatorFactory has been built 2021-02-14 17:29:08 +01:00
Sam Brannen 03f1b65084 Polish Javadoc for ResourceLoader APIs 2021-01-26 12:20:28 +01:00
Sam Brannen 9d8910d869 Improve inline documentation for PostProcessorRegistrationDelegate
This commit introduces warnings in invokeBeanFactoryPostProcessors()
and registerBeanPostProcessors() to deter people from submitting PRs
that result in breaking changes.

Closes gh-26401
2021-01-22 13:34:29 +01:00
Stephane Nicoll 4779323d33 Clarify behaviour of condition attribute of CachePut
Closes gh-26186
2021-01-19 15:14:26 +01:00
Arjen Poutsma 67112b211a Rollback to midnight in quartz expressions
This commit makes sure that the CronExpression rolls back the time to
midnight when dealing with Quartz expression fields (such as "L", "LW",
etc.).

Closes gh-26390
2021-01-19 15:06:40 +01:00
Juergen Hoeller 799885fd6d Introduce public defineClass variant for SmartClassLoader implementations
Closes gh-26403
2021-01-19 12:03:18 +01:00
Juergen Hoeller 4ac27e4dab Suppress ClassCastException for payload type mismatch as well
Closes gh-26349
2021-01-11 09:44:38 +01:00
Arjen Poutsma d387d9ae1e Allow quartz expression in cron expression lists
This commit introduces support for lists of quartz cron fields, such
as "1L, LW" or "TUE#1, TUE#3, TUE#5".

Closes gh-26289
2021-01-07 14:27:07 +01:00
Arjen Poutsma 4f6d26b25c Parse list with range delta in CronExpression
Closes gh-26313
2021-01-04 16:02:28 +01:00
Sam Brannen 91a6254187 Test status quo for repeatable @PropertySource on composed annotation
This commit introduces tests that verify support for using
@PropertySource as a repeatable annotation without the
@PropertySources container, both locally on an @Configuration class
and on a custom composed annotation.

See gh-26329
2021-01-02 16:21:53 +01:00
Sam Brannen c8ad762b40 Polishing 2021-01-02 16:21:53 +01:00
Sam Brannen 5c1176786c Test status quo for list support in CronExpression
See gh-26289
2020-12-30 14:38:58 +01:00
Juergen Hoeller 00b56c026a Consistent handling of NullBean instances in resolveNamedBean
Closes gh-26271
2020-12-16 22:27:41 +01:00
Sébastien Deleuze e87e03c539 Refine ConfigurationClassPostProcessor behavior in native images
This commit refines ConfigurationClassPostProcessor behavior in
native images by skipping configuration classes enhancement
instead of raising an error.

See spring-projects-experimental/spring-graalvm-native#248 for
more details.

Closes gh-26236
2020-12-08 00:12:02 +01:00
Juergen Hoeller c970c318f4 Polishing 2020-12-07 22:08:01 +01:00
Brian Clozel 4337d8465c Remove spring.event.invoke-listener startup event
Prior to this commit, the `SimpleApplicationEventMulticaster` would be
instrumented with the `ApplicationStartup` and start/stop events for
invoking event listeners (`spring.event.invoke-listener`).

This feature was already limited to single-threaded event publishers,
but is still flawed since several types of events can happen
concurrently. Due to the single-threaded nature of the startup sequence,
our implementation should not produce startup events concurrently.

This can cause issues like gh-26057, where concurrent events lead to
inconcistencies when tracking parent/child relationships.

This commit removes the `spring.event.invoke-listener` startup event as
a result.

Fixes gh-26057
2020-12-03 15:40:31 +01:00
Johnny Lim c7f2f50c15
Polish ConfigurationClassPostProcessorTests
Closes gh-26197
2020-12-02 15:07:15 +01:00
Juergen Hoeller 56dbe06d9b Register @Bean definitions as dependent on containing configuration class
Closes gh-26167
2020-11-27 17:00:16 +01:00
Juergen Hoeller 86f9716fef Remove misleading default note on ISO.DATE_TIME
Closes gh-26134
2020-11-25 11:35:06 +01:00
Сергей Цыпанов e1f51b4bf8 Avoid multiple volatile reads/writes in a row where only one is enough 2020-11-05 12:25:24 +01:00
Juergen Hoeller 412aa06d86 Reliably refresh metadata for dynamically changing prototype bean class
Closes gh-26019
2020-11-04 16:48:54 +01:00
Juergen Hoeller d5b3e65718 Add since tag
See gh-26025
2020-11-04 16:46:44 +01:00
Erik van Paassen fbf8e37f94 Add FullyQualifiedAnnotationBeanNameGenerator.INSTANCE
Adds a static INSTANCE to FullyQualifiedAnnotationBeanNameGenerator,
just like its parent class, AnnotationBeanNameGenerator, does.

The class doesn't have any state and overriding/hiding the INSTANCE of
the superclass, this prevents unintended use of a regular
AnnotationBeanNameGenerator through
FullyQualifiedAnnotationBeanNameGenerator.INSTANCE.
2020-11-04 16:29:31 +01:00
Juergen Hoeller 95110d8257 Introduce TransactionalApplicationListener interface (with callback support)
Includes forPayload methods and common adapter classes for programmatic usage.
Aligns default order values for event handling delegates to LOWEST_PRECEDENCE.

Closes gh-24163
2020-10-22 15:19:32 +02:00
Сергей Цыпанов 8a04910bdd Drop explicit zeroing at instantiation of Atomic* objects 2020-10-06 15:45:12 +02:00
Juergen Hoeller 7116e5f755 Polishing 2020-09-25 20:40:54 +02:00
Sébastien Deleuze 2dbceb9053 Deprecate LiveBeansView
This commit deprecates LiveBeansView and related classes in order to allow
a future removal in order to increase the separation of concerns between
Spring Framework and Spring Boot, and the consistency between JVM
and native.

Closes gh-25820
2020-09-25 20:04:34 +02:00
Brian Clozel 61d893257e Rewrite "performance" test to JMH benchmarks
This commit rewrites the remaining "fastEnough" performance tests into
proper JMH benchmarks.

See gh-24830
2020-09-25 13:43:38 +02:00
Brian Clozel e02d3f32b4 Requalify tests as LONG_RUNNING
Prior to this commit, some tests would belong to the PERFORMANCE
`TestGroup`, while they were not testing for performance but rather
performing functional tests that involve long running operations or
timeouts.

This commit moves those tests to the LONG_RUNNING `TestGroup`.

See gh-24830
2020-09-25 13:43:38 +02:00
Juergen Hoeller 6c631e3d5c Merge branch '5.2.x'
# Conflicts:
#	spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java
2020-09-25 11:36:18 +02:00
Juergen Hoeller c83f6adc24 Revise event multicaster locking for non-synchronized retriever caching
Closes gh-25799
2020-09-25 11:24:26 +02:00
Sam Brannen d7fab85f51 Merge branch '5.2.x' 2020-09-25 11:17:24 +02:00
Sam Brannen f5d36aa47a Revert use of Map::computeIfAbsent in thread and tx scopes
Issues gh-25038 and gh-25618 collectively introduced a regression for
thread-scoped and transaction-scoped beans.

For example, given a thread-scoped bean X that depends on another
thread-scoped bean Y, if the names of the beans (when used as map keys)
end up in the same bucket within a ConcurrentHashMap AND an attempt is
made to retrieve bean X from the ApplicationContext prior to retrieving
bean Y, then the use of Map::computeIfAbsent in SimpleThreadScope
results in recursive access to the same internal bucket in the map.

On Java 8, that scenario simply hangs. On Java 9 and higher,
ConcurrentHashMap throws an IllegalStateException pointing out that a
"Recursive update" was attempted.

In light of these findings, we are reverting the changes made to
SimpleThreadScope and SimpleTransactionScope in commits 50a4fdac6e and
148dc95eb1.

Closes gh-25801
2020-09-25 11:00:06 +02:00
Juergen Hoeller bbe74635eb Merge branch '5.2.x' 2020-09-18 18:16:33 +02:00
Juergen Hoeller c1617d3c52 Polishing 2020-09-18 18:15:36 +02:00
Juergen Hoeller 051de3f179 Configurable java.time.Clock on TaskScheduler implementations
Closes gh-25782
2020-09-18 10:21:48 +02:00
Juergen Hoeller e4a3d5bf66 Deprecation wording with suggested alternative and without removal hint
See gh-25733
See gh-25736
2020-09-15 13:22:34 +02:00
Brian Clozel 078543ce67 Deprecate Joda time support
This commit deprecates the Joda time support and schedules it for
removal in 6.0.

Closes gh-25736
2020-09-08 14:46:48 +02:00
Arjen Poutsma 91b609817e Do not use BitSet in BitsCronField
This commit changes BitsCronField to use a long instead of a BitSet,
since the later can use significant memory.

Closes gh-25687
2020-09-08 10:11:32 +02:00
Juergen Hoeller 3cc0db5fc3 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-09-07 19:27:25 +02:00
Juergen Hoeller 4b211fb18c Javadoc refinements 2020-09-07 19:20:26 +02:00