Commit Graph

2046 Commits

Author SHA1 Message Date
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
Juergen Hoeller 75f394ca85 Merge branch '5.2.x' 2020-09-07 17:54:51 +02:00
Juergen Hoeller 613b05d814 Properties loading with ignoreResourceNotFound covers SocketException as well
Closes gh-25717
2020-09-07 17:51:14 +02:00
Brian Clozel c5694506ae Early configuration of ApplicationStartup on BeanFactory
Prior to this commit, the `GenericApplicationContext` configured the
`AppliationStartup` on the `BeanFactory` only right before refreshing it.
Delaying this has no purpose and we should instead configure it as soon
as possible by overriding the setter method.

Closes gh-25718
2020-09-07 10:48:59 +02:00
Yanming Zhou a2bb59f1b8 Replace StringBuffer with StringBuilder where possible 2020-09-03 22:40:51 +02:00
Stephane Nicoll a06deac5db Merge branch '5.2.x' 2020-09-02 11:29:25 +02:00
Stephane Nicoll cdfdc340d2 Log cache hit and cache miss for synchronized access
Closes gh-25248
2020-09-02 11:29:03 +02:00
Juergen Hoeller 689adb4bd0 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-09-01 23:46:11 +02:00
Juergen Hoeller 141470ff58 Explicit nullability declarations for getTarget() implementations 2020-09-01 23:26:22 +02:00
Сергей Цыпанов 1f3e52d932 gh-25650 Replace remaining usage of LinkedList with ArrayList in tests 2020-08-31 14:33:14 +02:00
Juergen Hoeller 00c5dbf11a Merge branch '5.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
2020-08-28 20:01:17 +02:00
Juergen Hoeller 6d9d4157ef Specifically detect Joda-Time 2.x
Closes gh-25655
2020-08-28 19:57:51 +02:00
Juergen Hoeller 2080878d82 Merge branch '5.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
2020-08-27 14:40:54 +02:00
Juergen Hoeller cf2e0c7959 Selected use of ArrayList instead of LinkedList in common places
See gh-25652
2020-08-27 14:14:44 +02:00
Juergen Hoeller 60fa704f78 Consistent behavior for overloaded @Bean methods with ASM processing
Closes gh-25263
2020-08-27 14:13:33 +02:00
Juergen Hoeller 874574513c Replace remaining usage of LinkedList with ArrayList/ArrayDeque
Closes gh-25650
2020-08-26 18:32:08 +02:00
Juergen Hoeller ff11467a0c Avoid resizing of fixed-size HashMap/LinkedHashMap variants
Closes gh-25349
2020-08-25 19:26:18 +02:00
Juergen Hoeller 7324140d20 Merge branch '5.2.x' 2020-08-25 16:21:00 +02:00
Juergen Hoeller 6f0461c569 Polishing 2020-08-25 16:17:22 +02:00
Juergen Hoeller 04df9b8f49 Efficient checks for empty strings and single character matches
Closes gh-25552
Closes gh-25553
2020-08-25 16:17:12 +02:00
Juergen Hoeller 0d4040aa63 Avoid potential integer overflow in seconds->millis transformation
Closes gh-25613
2020-08-25 16:16:34 +02:00
Sam Brannen 0f7ad1b5bf Merge branch '5.2.x' 2020-08-22 23:50:28 +02:00
Sam Brannen 148dc95eb1 Fix regressions in SimpleThreadScope and SimpleTransactionScope
PR gh-25038 introduced regressions in SimpleThreadScope and
SimpleTransactionScope in Spring Framework 5.2.7. Specifically, if a
thread-scoped or transaction-scoped bean has a dependency on another
thread-scoped or transaction-scoped bean, respectively, a
ConcurrentModificationException will be thrown on Java 11 or higher.

The reason is that Java 11 introduced a check for concurrent
modification in java.util.HashMap's computeIfAbsent() implementation,
and such a modification can occur when a thread-scoped bean is being
created in order to satisfy a dependency of another thread-scoped bean
that is currently being created.

This commit fixes these regressions by switching from HashMap to
ConcurrentHashMap for the instance maps in SimpleThreadScope and
SimpleTransactionScope.

Closes gh-25618
2020-08-22 23:19:58 +02:00
Sam Brannen 1891f8af70 Merge branch '5.2.x' 2020-08-16 20:04:24 +02:00
Sam Brannen 93e5214d01 Revise Javadoc regarding log level for non-static BFPP @Bean method
Closes gh-25590
2020-08-16 20:03:46 +02:00
Sam Brannen c558391e2c Declare interfaces as @FunctionalInterface where feasible
This commit declares each of the following public interfaces as a
@FunctionalInterface.

- org.springframework.context.ApplicationContextInitializer
- org.springframework.test.web.servlet.DispatcherServletCustomizer
- org.springframework.validation.MessageCodeFormatter
- org.springframework.util.IdGenerator
- org.springframework.beans.factory.config.YamlProcessor.MatchCallback
- org.springframework.beans.factory.config.YamlProcessor.DocumentMatcher

Closes gh-25580
2020-08-11 17:01:03 +02:00
Sam Brannen 1f35cc5cae Polish contribution
See gh-25506
2020-08-10 14:17:04 +02:00
Qimiao Chen af8ab2e3a8 Optimize DefaultLifecycleProcessor::startBeans
Closes gh-25506
2020-08-10 14:08:14 +02:00
Juergen Hoeller e87a49c61c Merge branch '5.2.x' 2020-08-07 21:43:33 +02:00
Juergen Hoeller 292f581cdd Populate dependencies metadata for resolved target behind lazy dependency proxy
Closes gh-25562
2020-08-07 21:42:02 +02:00
Juergen Hoeller f4c0ceb1cc Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java
#	spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java
2020-08-07 13:15:36 +02:00
Juergen Hoeller 8dd285f877 Polishing 2020-08-07 13:02:43 +02:00
Juergen Hoeller b345019415 Introduce getBeanProvider variants with allowEagerInit flag
Closes gh-25559
2020-08-07 12:07:13 +02:00