Commit Graph

4367 Commits

Author SHA1 Message Date
Sam Brannen
bfd3dc2676 Implement toString() in RetryPolicy and RetryExecution implementations
Closes gh-35029
2025-06-11 19:17:03 +02:00
Sam Brannen
bc967842f6 Rename and polish ComposedRetryListenerTests 2025-06-11 19:04:48 +02:00
Sam Brannen
b6680422db Change signature of RetryOperations.execute() regarding nullability
Due to lacking support in NullAway for the current arrangement, we are
(perhaps temporarily) changing the signature of the execute() method in
RetryOperations (and thus also in RetryTemplate)...

from: <R extends @Nullable Object> R execute(Retryable<R> retryable);

to:   <R> @Nullable R execute(Retryable<? extends @Nullable R> retryable);

Once https://github.com/uber/NullAway/issues/1075 has been resolved, we
will consider switching back to the original signature.

See gh-34716
2025-06-11 17:43:29 +02:00
Sam Brannen
8f3ca49bc4 Rename Retryable.run() to Retryable.execute()
See gh-34716
2025-06-11 13:50:16 +02:00
Sam Brannen
d74b863ae7 Polish Javadoc for core retry functionality
See gh-34716
2025-06-11 13:49:00 +02:00
Sam Brannen
8b9e620084 Allow FixedBackOff to be constructed with only a custom interval
This commit introduces two new constructors:

- FixedBackOff(long)

- FixedBackOff(Duration)

Closes gh-35028
2025-06-11 13:26:16 +02:00
Sam Brannen
fcdd439ad0 Polish Javadoc for FixedBackOff 2025-06-11 13:06:55 +02:00
Sébastien Deleuze
b901132192 Merge branch '6.2.x' 2025-06-11 10:15:36 +02:00
Sébastien Deleuze
05c3f56ec7 Rely on default retention in @Contract
Closes gh-35027
2025-06-11 10:14:59 +02:00
Sam Brannen
d42d3f1a6c Fix wording in Javadoc for RetryTemplate
See gh-34716
2025-06-10 18:34:56 +02:00
Sam Brannen
51b6e8cc9f Rename RetryCallback to Retryable
See gh-34716
2025-06-10 18:26:52 +02:00
Sam Brannen
f927ff635a Revise @⁠Nullable declarations for contains*() in CollectionUtils
Closes gh-35023
2025-06-10 17:50:37 +02:00
Sébastien Deleuze
be02d961fc Merge branch '6.2.x' 2025-06-09 16:55:33 +02:00
Sébastien Deleuze
7bb19fcde8 Refine Kotlin Serialization hint registration
This commit adds support for serializer methods with a parameter.

Closes gh-34979
2025-06-09 16:48:15 +02:00
Sam Brannen
077146d636 Merge branch '6.2.x' 2025-06-09 14:12:45 +02:00
Sam Brannen
18d6a55e3e Polishing and removal of "this." for method invocations 2025-06-09 14:10:30 +02:00
Sam Brannen
315bbf3abe Consistently declare nullability @⁠Contract for core utilities
Closes gh-34934
2025-06-07 11:41:38 +02:00
Sam Brannen
7a6f9bd3c3 Use @⁠TempDir in FileSystemUtilsTests 2025-06-06 16:34:56 +02:00
Sam Brannen
3aa3b81e1c Update copyright headers 2025-06-06 13:49:23 +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
Juergen Hoeller
167350d408 Merge branch '6.2.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
#	spring-aop/src/main/java/org/springframework/aop/aspectj/ShadowMatchUtils.java
2025-06-05 20:39:20 +02:00
Juergen Hoeller
a266e1b403 Close JarFile only in case of useCaches=false
Closes gh-34955
2025-06-05 20:20:47 +02:00
Sam Brannen
02af9e5cee Revise core retry support
This commit constitutes a first pass over the new core retry support.

- Fix code and Javadoc formatting

- Polish/fix Javadoc

- Fix default FixedBackOff configuration in RetryTemplate

- Consistent logging in RetryTemplate

- Fix listener handling in CompositeRetryListener, allowing addListener()
  to work

- Polish tests

- Ensure RetryTemplateTests do not take over 30 seconds to execute

See gh-34716
2025-06-05 14:56:25 +02:00
Mahmoud Ben Hassine
3fb4a75ae4 Introduce minimal retry functionality as a core framework feature
This commit introduces a minimal core retry feature. It is inspired
by Spring Retry, but redesigned and trimmed to the bare minimum to
cover most cases.

Closes gh-34716
2025-06-05 14:56:25 +02:00
Brian Clozel
5fbb81de10 Fix missing "since" attributes for Deprecated code
See gh-34989
2025-06-05 09:25:10 +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
b7dfd68d89 Merge branch '6.2.x' 2025-06-04 14:11:07 +02:00
Sam Brannen
4df93a825b Update copyright headers and fix test method name 2025-06-04 11:28:55 +02:00
rstoyanchev
b699b65b40 Merge branch '6.2.x' 2025-06-03 19:11:52 +01:00
Tran Ngoc Nhan
3f0892b42c Fix typos
Closes gh-34876

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-06-03 18:55:15 +01:00
Brian Clozel
7c82a62bfb Merge branch '6.2.x' 2025-06-03 18:07:22 +02:00
Patrick Strawderman
182d654fa8 Add optimized DataBufferInputStream overrides
Add optimized DataBufferInputStream overrides for readNBytes, skip, and transferTo; all of them
allocate byte buffers which we can either avoid (in the case of skip) or size more precisely since
the number of remaining bytes is known.

Closes gh-34799

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-06-03 18:06:43 +02:00
Sam Brannen
9782dfb620 Fix nullability @⁠Contract for SupplierUtils.resolve(Supplier)
Closes gh-34987
2025-06-03 13:15:58 +02:00
Sébastien Deleuze
20ddd9f864 Polish KotlinReflectionParameterNameDiscoverer 2025-05-28 11:16:09 +02:00
Sam Brannen
6f6e0d45a9 Merge branch '6.2.x' 2025-05-26 17:37:08 +02:00
Sam Brannen
6a6abac003 Polish Javadoc for MockPropertySource 2025-05-26 17:21:31 +02:00
Sam Brannen
e5a3c43fbc Merge branch '6.2.x' 2025-05-22 17:26:11 +02:00
Sam Brannen
db5809f968 Remove obsolete @⁠Contract declaration for StreamUtils.drain()
Closes gh-34933
2025-05-22 17:23:35 +02:00
Sam Brannen
efea28953d Improve Javadoc for getFilename() & getFilenameExtension() in StringUtils
Closes gh-34932
2025-05-22 17:03:09 +02:00
Stéphane Nicoll
9d3779db49 Declare @⁠Contract for quote() & getFilename() in StringUtils
This commit declares nullability @⁠Contract annotations for quote() and
getFilename() in StringUtils.

Closes gh-34896


Signed-off-by: Stéphane Nicoll <stephane.nicoll@broadcom.com>
2025-05-21 17:43:23 +02:00
rstoyanchev
ea340fbe69 Merge branch '6.2.x' 2025-05-14 15:16:12 +01:00
rstoyanchev
3c228a5c1d Add missing @since tags in PatternMatchUtils
See: gh-34801
2025-05-14 15:15:50 +01:00
Brian Clozel
bf78980925 Merge branch '6.2.x' 2025-05-14 09:58:54 +02:00
Patrick Strawderman
37ecdd1437 Forward more methods to underlying InputStream in NonClosingInputStream
NonClosingInputStream extends FilterInputStream, which does not forward some
newer InputStream methods such as transferTo and readAllBytes. Specific InputStream
implementations may have more optimized methods (e.g., FileInputStream).

Closes gh-34893

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-05-14 09:58:23 +02:00
Juergen Hoeller
254a55d217 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-05-13 16:31:05 +02:00
Brian Clozel
0df75ff75e Fix StringIndexOutOfBoundsException with Class-File metadata
Closes gh-34882
2025-05-13 16:15:00 +02:00
Juergen Hoeller
6a9444473f Clarify CompositePropertySource behavior for EnumerablePropertySource contract
Closes gh-34886
2025-05-13 16:08:03 +02:00
Sam Brannen
680094d74e Merge branch '6.2.x' 2025-05-13 13:45:37 +02:00
Sam Brannen
03ae97b2eb Introduce Spring property for default escape character for placeholders
Spring Framework 6.2 introduced support for an escape character for
property placeholders (by default '\'). However, as of Spring Framework
6.2.6, there was no way to either escape the escape character or disable
escape character support.

For example, given a `username` property configured with the value of
`Jane.Smith` and a `DOMAIN\${username}` configuration string, property
placeholder replacement used to result in `DOMAIN\Jane.Smith` prior to
6.2 but now results in `DOMAIN${username}`. Similarly, an attempt to
escape the escape character via `DOMAIN\\${username}` results in
`DOMAIN\${username}`.

In theory, one should be able to disable use of an escape character
altogether, and that is currently possible by invoking
setEscapeCharacter(null) on AbstractPropertyResolver and
PlaceholderConfigurerSupport (the superclass of
PropertySourcesPlaceholderConfigurer).

However, in reality, there are two hurdles.

- As of 6.2.6, an invocation of setEscapeCharacter(null) on a
  PropertySourcesPlaceholderConfigurer applied to its internal
  top-level PropertySourcesPropertyResolver but not to any nested
  PropertySourcesPropertyResolver, which means that the `null` escape
  character could not be effectively applied.

- Users may not have an easy way to explicitly set the escape character
  to `null` for a PropertyResolver or
  PropertySourcesPlaceholderConfigurer. For example, Spring Boot
  auto-configures a PropertySourcesPlaceholderConfigurer with the
  default escape character enabled.

This first issue above has recently been addressed by gh-34861.

This commit therefore addresses the second issue as follows.

- To allow developers to easily revert to the pre-6.2 behavior without
  changes to code or configuration strings, this commit introduces a
  `spring.placeholder.escapeCharacter.default` property for use with
  SpringProperties which globally sets the default escape character that
  is automatically configured in AbstractPropertyResolver and
  PlaceholderConfigurerSupport.

- Setting the property to an empty string sets the default escape
  character to `null`, effectively disabling the default support for
  escape characters.

    spring.placeholder.escapeCharacter.default =

- Setting the property to any other character sets the default escape
  character to that specific character.

    spring.placeholder.escapeCharacter.default = ~

- Setting the property to a string containing more than one character
  results in an exception.

- Developers are still able to configure an explicit escape character
  in AbstractPropertyResolver and PlaceholderConfigurerSupport if they
  choose to do so.

- Third-party components that wish to rely on the same feature can
  invoke AbstractPropertyResolver.getDefaultEscapeCharacter() to obtain
  the globally configured default escape character.

See gh-9628
See gh-34315
See gh-34861
Closes gh-34865
2025-05-13 13:37:30 +02:00