Commit Graph

752 Commits

Author SHA1 Message Date
Sébastien Deleuze 7635ac38f6 Use uppercase for classpath-related static final field names
Closes gh-35525
2025-09-22 18:32:14 +02:00
Sam Brannen 0c61ac956b Add missing @⁠Override annotations
... and suppress "serial" warnings
2025-09-22 13:20:37 +02:00
Sébastien Deleuze da0a36bfd6 Upgrade to NullAway 0.12.10 and refine nullability
Closes gh-35492
2025-09-17 15:17:23 +02:00
Sam Brannen bb2a259d85 Wrap exceptionally long lines 2025-08-19 17:28:11 +02:00
Sam Brannen 5d325ca0fc Improve wording for transactional rollback rule semantics
Closes gh-35346
2025-08-19 13:32:35 +02:00
Juergen Hoeller 4bfc129f84 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:24], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Update Antora UI Spring / Update on Supported Branches (6.1.x) (push) Has been cancelled Details
Update Antora UI Spring / Update on docs-build (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
2025-08-01 21:17:54 +02:00
Juergen Hoeller da13a24604 Allow any @Transactional propagation for listener with BEFORE_COMMIT phase
Backport Bot / build (push) Has been cancelled Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
Closes gh-35150
2025-08-01 21:15:56 +02:00
Juergen Hoeller a3e9f0c16d Add bindSynchronizedResource with automatic unbinding after transaction completion
Closes gh-35182
2025-07-10 17:13:51 +02:00
Sébastien Deleuze a61b297967 Specify flexible generics nullness in spring-jdbc
This commit leverages flexible generics nullness at method and
type level when relevant in spring-jdbc.

Due to https://github.com/uber/NullAway/issues/1075, some related
`@SuppressWarnings("NullAway")` have been added.

JdbcOperations Kotlin extensions have been refined accordingly.

Closes gh-34911
2025-07-07 16:35:25 +02:00
Yanming Zhou 410a9ce108 Mark applicable Scope's methods as default
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-07-07 13:37:47 +02:00
Juergen Hoeller 196b7ec275 Deprecate (Jdbc)DaoSupport classes (including JmsGatewaySupport)
Closes gh-35145
2025-07-02 11:12:57 +02:00
Spring Builds 16edf9867a Update copyright headers in source files
This commit updates Java, Kotlin, and Groovy source files to use the
"<year>-present" pattern in copyright headers.

Closes gh-35070
2025-06-17 16:23:50 +02:00
Spring Builds aee29b7f30 Update copyright headers in source files
This commit updates Java, Kotlin, and Groovy source files to use the
"<year>-present" pattern in copyright headers.

Closes gh-35070
2025-06-17 15:54:58 +02:00
Johnny Lim 7f6a7b806e Replace AssertionsForClassTypes with Assertions
Closes gh-34821

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-06 13:49:23 +02:00
rstoyanchev 230540b6da Polishing contribution
Closes gh-34942
2025-06-04 13:46:22 +01:00
Yanming Zhou f9fa7cc93b Add missing "since" in `@Deprecated`
See gh-34942

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-06-04 13:46:22 +01:00
Sam Brannen df4868bf83 Merge branch '6.2.x' 2025-04-10 16:49:43 +02:00
Sam Brannen cd987fc104 Update Javadoc to stop mentioning 5.3.x as the status quo
Closes gh-34740
2025-04-10 16:40:04 +02:00
Juergen Hoeller 73c4b46ed7 Merge branch '6.2.x' 2025-03-19 11:00:39 +01:00
Juergen Hoeller cc986cd2e8 Defer triggerAfterCompletion invocation in doRollbackOnCommitException
Closes gh-34595
2025-03-19 10:59:46 +01:00
Sam Brannen e05d4f2f18 Merge branch '6.2.x' 2025-03-18 16:42:37 +01:00
Sam Brannen c6a9aa59a3 Remove BDDMockito Checkstyle rule
This commit removes the BDDMockito Checkstyle rule, since it did not
actually enforce the use of BDDMockito.

This commit also updates static imports to use Mockito instead of
BDDMockito where appropriate (automated via the Eclipse IDE Organize
Imports clean-up task).

Closes gh-34616
2025-03-18 16:35:57 +01:00
Johnny Lim 042b78f609 Fix Javadoc @code tags
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-01-30 13:33:42 +09:00
Brian Clozel f85752a956 Fix hints and predicates for Field reflective access
This commit revisits the arrangement for Field hints after changes made
in gh-34239.

Closes gh-34294
2025-01-21 20:05:12 +01:00
Juergen Hoeller 87da67165a Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
2025-01-13 13:06:14 +01:00
Juergen Hoeller ff72652890 Defensively check expected type for qualified bean
Closes gh-34187
2025-01-13 13:03:25 +01:00
Sébastien Deleuze bc5d771a06 Switch to JSpecify annotations
This commit updates the whole Spring Framework codebase to use JSpecify
annotations instead of Spring null-safety annotations with JSR 305
semantics.

JSpecify provides signficant enhancements such as properly defined
specifications, a canonical dependency with no split-package issue,
better tooling, better Kotlin integration and the capability to specify
generic type, array and varargs element null-safety. Generic type
null-safety is not defined by this commit yet and will be specified
later.

A key difference is that Spring null-safety annotations, following
JSR 305 semantics, apply to fields, parameters and return values,
while JSpecify annotations apply to type usages. That's why this
commit moves nullability annotations closer to the type for fields
and return values.

See gh-28797
2024-12-19 11:07:23 +01:00
Sébastien Deleuze 83517d05d0 Merge branch '6.2.x' 2024-12-10 11:51:19 +01:00
Sébastien Deleuze a00ba8dbcf Revert "Reuse NoTransactionInContextException instances"
This reverts commit 8e3846991d.

Closes gh-34048
2024-12-10 11:47:56 +01:00
Juergen Hoeller 2b9010c2a2 Remove APIs marked as deprecated for removal
Closes gh-33809
2024-12-04 13:19:39 +01:00
Sam Brannen 078d683f47 Merge branch '6.2.x' 2024-12-04 12:04:37 +01:00
Sam Brannen 8d69370b95 Consider logical equality in AdvisedSupport.MethodCacheKey#equals
Prior to this commit, the equals() implementation in AdvisedSupport's
MethodCacheKey only considered methods to be equal based on an identity
comparison (`==`), which led to duplicate entries in the method cache
for the same logical method.

This is caused by the fact that AdvisedSupport's
getInterceptorsAndDynamicInterceptionAdvice() method is invoked at
various stages with different Method instances for the same method:

1) when creating the proxy
2) when invoking the method via the proxy

The reason the Method instances are different is due to the following.

- Methods such as Class#getDeclaredMethods() and
  Class#getDeclaredMethod() always returns "child copies" of the
  underlying Method instances -- which means that `equals()` should be
  used instead of (or in addition to) `==` whenever the compared Method
  instances can come from different sources.

With this commit, the equals() implementation in MethodCacheKey now
considers methods equal based on identity or logical equality, giving
preference to the quicker identity check.

See gh-32586
Closes gh-33915
2024-12-04 12:04:02 +01:00
Sam Brannen f243abbce3 Merge branch '6.2.x' 2024-12-01 16:39:10 +01:00
Sam Brannen 320831b18a Test status quo for StaticMethodMatcherPointcut#matches invocations
This commit introduces a test which verifies how many times the
matches() method of a StaticMethodMatcherPointcut is invoked during
ApplicationContext startup as well as during actual method invocations
via the advice chain, which also indirectly tests the behavior of the
equals() implementation in AdvisedSupport.MethodCacheKey.

In addition, this commit revises BeanFactoryTransactionTests to assert
that a transaction is started for the setAge() method.

See gh-33915
2024-12-01 16:28:32 +01:00
Sam Brannen 172c8b2c35 Polish AOP tests 2024-12-01 15:32:03 +01:00
Brian Clozel ba312f6c7c Update AOT support after RuntimeHints changes
This commit adapts AOT support in various modules after the RuntimeHints
and related deprecation changes.

`MemberCategory.INTROSPECT_*` hints are now removed and
`MemberCategory.*_FIELDS` are  replaced with
`MemberCategory.INVOKE*_FIELDS` when invocation is needed.

Usage of `RuntimeHintsAgent` are also deprecated.

Closes gh-33847
2024-11-29 14:44:05 +01:00
Juergen Hoeller 25e2c1b7ce Merge branch '6.1.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java
2024-11-13 15:12:55 +01:00
Juergen Hoeller 62eb21f938 Add note on declaring autowired fields as ObjectProvider
Closes gh-33834
2024-11-13 15:09:58 +01:00
Sam Brannen 1b3e96b9bf Merge branch '6.1.x' 2024-10-25 14:49:46 +02:00
Sam Brannen e340e45f5a Rename aopAvailable constants in TransactionSynchronizationUtils
Closes gh-33796
2024-10-25 14:41:41 +02:00
KimJuHyun f1cbbd2aa8 Remove redundant array length check
Closes gh-33655
2024-10-07 08:24:37 +02:00
Sébastien Deleuze 8e3846991d Reuse NoTransactionInContextException instances
New NoTransactionInContextException instances are created frequently in
TransactionContextManager#currentContext() when there is no transaction,
we could reuse the same instance instead to reduce the GC pressure.

Closes gh-33601
2024-09-27 17:45:02 +02:00
Juergen Hoeller d3dd01e227 Adapt transactional test component declaration
See gh-33470
2024-09-27 11:06:30 +02:00
오영택 cc3948e14c feat: Implemented to throw a runtime error if a class has @Transactional 2024-09-27 10:59:52 +02:00
Yanming Zhou 8941e2876e Replace 'e.g.' with 'for example' in documentation and comments
Closes gh-33515
2024-09-26 14:11:17 +02:00
Sam Brannen 717b972f88 Polish contribution
See gh-33452
2024-09-03 18:08:23 +02:00
Yanming Zhou 019c0b1d4e
Expand acronyms FQN and FQCN
Closes gh-33452
2024-09-03 17:30:27 +02:00
Juergen Hoeller 28668d774b Enforce non-null value in requiredSingleResult/requiredUniqueResult
Closes gh-33300
2024-08-05 15:53:17 +02:00
Simon Baslé 0c319a89d7 Merge branch '6.1.x' 2024-07-10 15:36:03 +02:00
Simon Baslé 1d890a8952 Make coroutines with custom AOP aspects work with `@Transactional`
Previous to this change, the transactional aspect would supersed the
user-defined AspectJ aspect, shortcircuiting to calling the original
Kotlin suspending function.

This change simplifies the TransactionAspectSupport way of dealing with
transactional coroutines, thanks to the fact that lower level support
for AOP has been introduced in c8169e5c.

Closes gh-33095
2024-07-10 15:35:43 +02:00