983 Commits

Author SHA1 Message Date
Yanming Zhou bfb88cfc1c Remove unnecessary invocations of toString()
Closes gh-36709

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-04-27 11:27:29 +03:00
Sam Brannen 8ca0262e2f Avoid the use of assertThat(Arrays.equals(...))
See gh-36504
2026-03-20 10:54:57 +01:00
Sam Brannen 2ce21f7654 Convert assertThat(x.equals(y)).isFalse() to assertThat(x).isNotEqualTo(y)
Search:

  assertThat\((?!\s*Arrays\.)(.+?)\.equals\((.+?)\)\)(.*?)\.isFalse\(\)

Replace:

  assertThat($1)$3.isNotEqualTo($2)

See gh-36504
2026-03-20 10:54:37 +01:00
Sam Brannen 399f779c43 Convert assertThat(x instanceof X).isFalse() to assertThat(x).isNotInstanceOf()
Search:  assertThat\((.+?) instanceof (.+?)\)(.*?)\.isFalse\(\)

Replace: assertThat($1)$3.isNotInstanceOf($2.class)

See gh-36504
2026-03-20 10:54:27 +01:00
Sam Brannen a40ec44cb7 Convert assertThat(x instanceof X).isTrue() to assertThat(x).isInstanceOf()
Search:  assertThat\((.+?) instanceof (.+?)\)(.*?)\.isTrue\(\)

Replace: assertThat($1)$3.isInstanceOf($2.class)

See gh-36504
2026-03-20 10:54:23 +01:00
Sam Brannen 4548f1ec66 Inline conditions in assertThat() statements
Search: assertThat\(conditions?[0-9]?\)

See gh-36504
2026-03-20 10:53:54 +01:00
Sam Brannen 1256307c83 Enable SpringJUnit5 Checkstyle rule
See gh-36496
Closes gh-36496
2026-03-18 18:38:43 +01:00
Sam Brannen 4c14abf0cd Remove obsolete "test" prefix from test method names
Although this commit also changes the visibility of some test methods
to package-private, the remainder of that task will be addressed in
conjunction with gh-36496.

Closes gh-36495
2026-03-18 18:16:15 +01:00
Sam Brannen 17699103dc Consistently use American English spelling
Since the Spring Framework uses American English spelling, this commit
updates Javadoc and the reference manual to ensure consistency in that
regard. However, there are two exceptions to this rule that arise due
to their use within a technical context.

- We use "cancelled/cancelling" instead of "canceled/canceling" in
  numerous places (including error messages).
- We use "implementor" instead of "implementer".

Closes gh-36470
2026-03-15 17:04:23 +01:00
Sébastien Deleuze bc01eeb433 Leverage JUnit 6 suspending function support
Closes gh-36215
2026-01-27 08:45:04 +01:00
Sébastien Deleuze 611811d8fc Anticipate fixing Kotlin 2.3 compilation warning
Closes gh-36203
2026-01-23 18:34:45 +01:00
木葉 Scarlet d077e043d6 Consistently declare @⁠Nullable on parameter in equals() implementations
Closes gh-36075

Signed-off-by: 木葉 Scarlet <93977077+mukjepscarlet@users.noreply.github.com>
2025-12-29 11:43:49 +02:00
Juergen Hoeller c813577908 Consistently use DefaultParameterNameDiscoverer.getSharedInstance()
This includes MethodParameter resolving getParameterName() by default now.
initParameterNameDiscovery(null) can be used to suppress such resolution.

Closes gh-36024
2025-12-17 13:39:02 +01:00
Juergen Hoeller e2ab9cd5da Use composed cache key for different SmartFactoryBean object types
Closes gh-35974
2025-12-09 12:59:19 +01:00
Sam Brannen 939aa84214 Revise type-level nullability in ConvertingComparator
This commit revises the type-level nullability declaration in
ConvertingComparator in order to adapt to recent nullability changes in
Converter.

This commit also revises the workaround in commit 53d9ba879d.

See gh-35947
2025-12-08 11:22:14 +01:00
Juergen Hoeller 53d9ba879d Suppress NullAway warning for nullable Annotation return value 2025-12-05 16:53:24 +01:00
Juergen Hoeller eadc5b09ac Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
2025-11-11 19:46:12 +01:00
Juergen Hoeller 40544e096f Fix typo in ProxyMethodInvocation javadoc 2025-11-11 19:42:02 +01:00
Sébastien Deleuze 694224f1a6 Remove outdated Spring version mentions
Close gh-35696
2025-10-28 13:58:09 +01:00
Juergen Hoeller b261b74793 Merge branch '6.2.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/framework/CoroutinesUtils.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/MutablePersistenceUnitInfo.java
#	spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/PersistenceXmlParsingTests.java
2025-10-18 15:32:19 +02:00
Juergen Hoeller 765e30c3a6 Polishing 2025-10-18 15:30:15 +02:00
Sam Brannen 0fbebd856f Revise contribution
See gh-35660
2025-10-18 13:50:22 +02:00
Kamil Krzywanski 948367092c Use empty array constants instead of repeatedly creating new ones
Closes gh-35660

Signed-off-by: Kamil Krzywański <kamilkrzywanski01@gmail.com>
Signed-off-by: Kamil Krzywanski <kamilkrzywanski01@gmail.com>
2025-10-18 13:36:06 +02:00
Juergen Hoeller 331f62fd03 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
2025-10-14 19:24:48 +02:00
Juergen Hoeller d733023a29 Consistently apply fallback attribute to proxy definition as well
See gh-35627
2025-10-14 19:17:57 +02:00
Schäfer, H.H. (Hans Hosea) df67c1cf2d 35626: defaultCandidate for scoped proxies
Signed-off-by: Schäfer, H.H. (Hans Hosea) <HansHosea.Schaefer@ing.de>
2025-10-14 19:07:03 +02:00
Juergen Hoeller edc14c2e15 Merge branch '6.2.x'
# Conflicts:
#	spring-context-indexer/src/main/java/org/springframework/context/index/processor/StandardStereotypesProvider.java
#	spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java
#	spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java
2025-10-09 20:37:49 +02:00
Juergen Hoeller c2a66e723f Polishing 2025-10-09 20:34:03 +02:00
Sébastien Deleuze acc3783509 Merge branch '6.2.x' 2025-10-01 19:26:06 +02:00
Sébastien Deleuze cb849a7071 Add a test for CGLIB Enhancer Kotlin refinements
This commit adds a reproducer for the change of behavior introduced via
https://youtrack.jetbrains.com/issue/KT-76667. The test is only broken
with Kotlin 2.2.20+ without the related fix (see previous commit).

Closes gh-35487
2025-10-01 19:21:40 +02:00
Sébastien Deleuze 7635ac38f6 Use uppercase for classpath-related static final field names
Closes gh-35525
2025-09-22 18:32:14 +02:00
Juergen Hoeller fa5ebbc1a8 Upgrade to Hibernate 7.1.1, Groovy 5.0.1, Commons Pool 2.12.1, SnakeYAML 2.5, Protobuf 4.32.1, ActiveMQ 5.17.7 and Artemis 2.42, EasyMock 5.6, AssertJ 3.27.4, XMLUnit 2.10.4, Dom4J 2.2
Includes downgrade to Log4J 2.25.1 from 3.0.0 beta (for Spring Framework 7.0 RC1)
2025-09-17 17:37:36 +02:00
Juergen Hoeller 5df9fd4eff Polishing (aligned with main) 2025-08-06 19:01:18 +02:00
Juergen Hoeller df86a9973d Introduce @Proxyable annotation for bean-specific proxy type
Closes gh-35296
See gh-35293
2025-08-06 18:26:40 +02:00
Juergen Hoeller 9edb96ae57 Introduce default ProxyConfig bean and exposed interfaces attribute
Taken into account by all proxy processors, this enables consistent proxy type defaulting in Spring Boot as well as consistent opting out for specific bean definitions.

Closes gh-35286
Closes gh-35293
2025-08-06 14:51:13 +02:00
Juergen Hoeller 64de254b58 Merge branch '6.2.x' 2025-07-11 22:50:47 +02:00
Juergen Hoeller 4277682a5c Catch InaccessibleObjectException next to IllegalAccessException
Closes gh-35190
2025-07-11 22:44:11 +02:00
Sam Brannen ddaf13b8ed Merge branch '6.2.x' 2025-07-11 15:52:54 +02:00
chenggwang 5aa15923cf Make targetBeanName field in AbstractBeanFactoryBasedTargetSource protected
Prior to this commit, subclasses of AbstractBeanFactoryBasedTargetSource
referenced the targetBeanName via getTargetBeanName() which throws an
IllegalStateException if the targetBeanName has not yet been set.

This commit changes the visibility of the targetBeanName field from
private to protected in order to facilitate direct access through
this.targetBeanName where no assertion is needed.

By doing so, we avoid exceptions in logging and toString()
implementations in subclasses.

Closes gh-35172

Signed-off-by: chenggwang <90715678+chenggwang@users.noreply.github.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2025-07-11 15:51:10 +02:00
Juergen Hoeller a2d495de9f Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
2025-07-07 14:40:50 +02:00
Juergen Hoeller 3bd96f72a6 Leniently tolerate null bean as aspect instance
Closes gh-35074
2025-07-07 14:26:19 +02:00
Sam Brannen b794abd8cb Polishing 2025-07-02 10:58:50 +02:00
Juergen Hoeller b256babad5 Polishing 2025-07-01 18:01:39 +02:00
Juergen Hoeller c9078bfe14 Introduce @ConcurrencyLimit annotation based on ConcurrencyThrottleInterceptor
Moves @Retryable infrastructure to resilience package in spring-context module.
Includes duration parsing and placeholder resolution for @Retryable attributes.
Provides convenient @EnableResilientMethods for @Retryable + @ConcurrencyLimit.

Closes gh-35133
See gh-34529
2025-07-01 17:27:50 +02:00
NeatGuyCoding 009b880e92 Fix potentially loses precision and jitter is not well capped with unit tests
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-07-01 10:56:53 +02:00
Sam Brannen 4cdfd90882 Polish backoff and retry support
This revises commit 15dd320b95.

See gh-34529
See gh-35110
2025-06-28 19:14:45 +02:00
Juergen Hoeller 15dd320b95 Consistent maxAttempts (long) and delay/maxDelay (Duration) declarations
Includes timeUnit attribute in @Retryable (aligned with @Scheduled).

See gh-34529
See gh-35110
2025-06-28 11:40:00 +02:00
Sam Brannen bcdf26d492 Redesign RetryPolicy to directly incorporate BackOff
After experimenting with our newly introduced core retry support
(RetryPolicy, RetryTemplate, etc.) and @⁠Retryable support, it
became apparent that there are overlapping concerns between the current
RetryPolicy and BackOff contracts.

- RetryPolicy and BackOff both have stateful executions: RetryExecution
  and BackOffExecution. However, only one stateful execution is
  necessary.

- FixedBackOff and ExponentialBackOff already incorporate "retry" logic
  in terms of max attempts, max elapsed time, etc. Thus, there is no
  need to duplicate such behavior in a RetryPolicy and its
  RetryExecution.

- RetryTemplate currently accepts both a RetryPolicy and a BackOff in
  order to instrument the retry algorithm. However, users would
  probably rather focus on configuring all "retry" logic via a single
  mechanism.

In light of the above, this commit directly incorporates BackOff
in RetryPolicy as follows.

- Remove the RetryExecution interface and move its shouldRetry() method
  to RetryPolicy, replacing the current RetryExecution start() method.

- Introduce a default getBackOff() method in the RetryPolicy interface.

- Introduce RetryPolicy.withDefaults() factory method.

- Completely overhaul the RetryPolicy.Builder to provide support for
  configuring a BackOff strategy.

- Remove BackOff configuration from RetryTemplate.

- Revise the method signatures of callbacks in RetryListener.

The collective result of these changes can be witnessed in the
reworked implementation of AbstractRetryInterceptor.

RetryPolicy retryPolicy = RetryPolicy.builder()
		.includes(spec.includes())
		.excludes(spec.excludes())
		.predicate(spec.predicate().forMethod(method))
		.maxAttempts(spec.maxAttempts())
		.delay(Duration.ofMillis(spec.delay()))
		.maxDelay(Duration.ofMillis(spec.maxDelay()))
		.jitter(Duration.ofMillis(spec.jitter()))
		.multiplier(spec.multiplier())
		.build();

RetryTemplate retryTemplate = new RetryTemplate(retryPolicy);

See gh-34716
See gh-34529
See gh-35058
Closes gh-35110
2025-06-27 17:28:10 +02:00
Sam Brannen 7cc29d2019 Revise naming and docs for "jitter" and "multiplier" in AOP retry support
See gh-34529
2025-06-27 16:17:40 +02:00
Sam Brannen f3f05da39b Refer to Spring Retry project in Javadoc 2025-06-25 16:38:48 +02:00