Commit Graph

29473 Commits

Author SHA1 Message Date
Sam Brannen
74fc8bd12d Polish SimpleAliasRegistryTests
See gh-31348
2023-10-03 15:29:22 +02:00
Enrico Freni
d507590abf Add missing unit tests for SimpleAliasRegistry
Closes gh-31348
2023-10-03 15:13:42 +02:00
Kai Zander
e8b42c5439 Optimize uses of onErrorResume()
This commit replaces uses of onErrorResume() with
- onErrorMap() in places where onErrorResume() is just used to map to a
  different exception.
- onErrorComplete() where onErrorResume() just maps to Mono.empty().
- onErrorReturn() where onErrorResum() just maps to Mono.just().

Closes gh-31352
2023-10-03 14:42:24 +02:00
Brian Clozel
14c5228288 Remove reflection hints workarounds for GraalVM issues
This commit removes the previously introduced reflection hints that were
working around known issues in GraalVM.
Spring Framework 6.1 will require recent maintenance versions of GraalVM
and should not contribute such hints anymore.

Closes gh-30394
2023-10-03 13:37:26 +02:00
Brian Clozel
1fd54912d2 Polish reflection hints on bean registration interfaces
This commit ensures that we register reflection hints on interfaces in
the entire type hierarchy.

Closes gh-31350
2023-10-03 11:24:47 +02:00
Brian Clozel
b832df6087 Add reflection hints for bean registration interfaces
Prior to this commit, the bean registration AOT contributions would
register introspection and invocation hints on both declared and public
methods for bean types. The bean introspection algorithm also looks at
default methods implemented by interfaces when collecting bean property
information.

This commit ensures that introspection hints are registered for all
implemented interfaces when registering beans.

Closes gh-31350
2023-10-02 19:33:05 +02:00
Sam Brannen
c45bf3c061 Merge branch '6.0.x' 2023-10-02 17:30:29 +02:00
Sam Brannen
147abc91a5 Polish BeanPropertyRowMapper Javadoc 2023-10-02 17:29:26 +02:00
Stéphane Nicoll
263931656b Merge pull request #31351 from izeye
* pr/31351:
  Add Javadoc since for ExponentialBackOff.DEFAULT_MAX_ATTEMPTS

Closes gh-31351
2023-10-02 17:04:17 +02:00
Johnny Lim
4a802c4e1f Add Javadoc since for ExponentialBackOff.DEFAULT_MAX_ATTEMPTS
See gh-31351
2023-10-02 17:04:05 +02:00
Stéphane Nicoll
699947c496 Merge branch '6.0.x' 2023-10-02 15:09:12 +02:00
Stéphane Nicoll
e12eb9436d Fix description of default behavior in BeanPropertyRowMapper
Closes gh-29285
2023-10-02 15:07:09 +02:00
Henning Poettker
9cab6c90a9 Allow custom observation convention for RestClient
This commit allows to use a custom `ObservationConvention`
in the `DefaultRestClient`, and to set it through the
`RestClient.Builder`.

Closes gh-31325
2023-10-02 14:55:01 +02:00
Sam Brannen
c356ce2637 Polishing 2023-10-01 16:42:51 +02:00
Sam Brannen
9f8293b9c9 Fix copy-n-paste error 2023-10-01 13:05:25 +02:00
Sam Brannen
dbf6f7dc9d Polish ExpressionState[Tests] 2023-09-30 11:45:20 +02:00
rstoyanchev
8fa428f825 Skip reconstructing body from request params if query present
This allows restoring optimization in StringHttpMessageConverter
that was undone in 23162b for 6.0.x.

Closes gh-31327
2023-09-29 18:01:18 +01:00
rstoyanchev
a6ab636614 Merge branch '6.0.x' 2023-09-29 18:00:52 +01:00
Sam Brannen
95838e18cc Clean up (boolean) (Boolean) casts in tests 2023-09-29 18:16:04 +02:00
rstoyanchev
23162bb306 Undo optimization from 12fe2c that can cause regression
Closes gh-31327
2023-09-29 17:15:23 +01:00
Sam Brannen
c3795731b5 Merge branch '6.0.x' 2023-09-29 17:48:15 +02:00
Sam Brannen
35f458fa5f Improve diagnostics for negative repeated text count in SpEL
Due to the changes in gh-31341, if the repeat count in a SpEL
expression (using the repeat operator '*') is negative, we throw a
SpelEvaluationException with the MAX_REPEATED_TEXT_SIZE_EXCEEDED
message which is incorrect and misleading.

Prior to gh-31341, a negative repeat count resulted in an
IllegalArgumentException being thrown by String#repeat(), which was
acceptable in terms of diagnostics, but that did not make it
immediately clear to the user what the underlying cause was.

In light of the above, this commit improves diagnostics for a negative
repeated text count in SpEL expressions by throwing a
SpelEvaluationException with a new NEGATIVE_REPEATED_TEXT_COUNT error
message.

Closes gh-31342
2023-09-29 17:45:21 +02:00
Sam Brannen
cddff46165 Merge branch '6.0.x' 2023-09-29 16:53:01 +02:00
Sam Brannen
8e83f93bcb Improve diagnostics for repeated text size overflow in SpEL
If the resulting size of repeated text in a SpEL expression (using the
repeat operator '*') would exceed MAX_REPEATED_TEXT_SIZE, we currently
throw a SpelEvaluationException with the
MAX_REPEATED_TEXT_SIZE_EXCEEDED message.

However, if the calculation of the repeated text size results in
integer overflow, our max size check fails to detect that, and
String#repeat(int) throws a preemptive OutOfMemoryError from which the
application immediately recovers.

To improve diagnostics for users, this commit ensures that we
consistently throw a SpelEvaluationException with the
MAX_REPEATED_TEXT_SIZE_EXCEEDED message when integer overflow occurs.

Closes gh-31341
2023-09-29 16:50:19 +02:00
Juergen Hoeller
a3e13c8ba8 Merge branch '6.0.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java
2023-09-29 15:01:43 +02:00
Juergen Hoeller
407113945d Polishing 2023-09-29 14:58:02 +02:00
Juergen Hoeller
4cf5c7796d Explicit note on local bean access within @PostConstruct method
Closes gh-27876
2023-09-29 14:57:40 +02:00
Juergen Hoeller
847e8a2b23 Restore auto-commit mode if not done by driver
Closes gh-31268
2023-09-29 14:57:17 +02:00
Sam Brannen
985eb5b8a1 Merge branch '6.0.x' 2023-09-29 13:52:44 +02:00
Sam Brannen
9aab4a60f5 Support safe navigation operator with void methods in SpEL
Prior to this commit the Spring Expression Language (SpEL) was able to
properly parse an expression that uses the safe navigation operator
(?.) with a method that has a `void` return type (for example,
"myObject?.doSomething()"); however, SpEL was not able to evaluate or
compile such expressions.

This commit addresses the evaluation issue by selectively not boxing
the exit type descriptor (for inclusion in the generated bytecode) when
the method's return type is `void`.

This commit addresses the compilation issue by pushing a null object
reference onto the stack in the generated byte code when the method's
return type is `void`.

Closes gh-27421
2023-09-29 13:49:48 +02:00
Sam Brannen
1fe2216c59 Test status quo for null-safe Void method references in SpEL 2023-09-29 13:36:38 +02:00
Sam Brannen
5ff9e6955c Test status quo for void function references in SpEL 2023-09-29 13:36:38 +02:00
Sam Brannen
0cb4043aac Polishing 2023-09-29 13:36:38 +02:00
Stéphane Nicoll
9e144afc0d Merge pull request #31328 from vpavic
* pr/31328:
  Polish "Fix regression in JmsAccessor#setSessionAcknowledgeMode"
  Fix regression in JmsAccessor#setSessionAcknowledgeMode

Closes gh-31328
2023-09-29 08:43:26 +02:00
Stéphane Nicoll
95e6902aef Polish "Fix regression in JmsAccessor#setSessionAcknowledgeMode"
See gh-31328
2023-09-29 08:42:56 +02:00
Vedran Pavic
11c2cde62e Fix regression in JmsAccessor#setSessionAcknowledgeMode
This commit partially reverts 3b8dd0a5, which introduced a strict
validation in JmsAccessor#setSessionAcknowledgeMode that prevents use
of vendor-specific acknowledge modes.

See gh-31328
2023-09-29 08:42:38 +02:00
rstoyanchev
a2c5fed494 Make targetType in UknownContentTypeException transient
Closes gh-31283
2023-09-28 16:52:03 +01:00
Stéphane Nicoll
ce9ca700f3 Enable test in AbstractAspectJAdvisorFactoryTests
See gh-24190
2023-09-28 15:46:47 +02:00
Juergen Hoeller
ef61b4eff3 SimpleAsyncTaskScheduler runs fixed-delay tasks on scheduler thread
Closes gh-31334
2023-09-28 14:34:01 +02:00
Juergen Hoeller
86b764d4d2 Expose public shouldHandle(ApplicationEvent) method
Closes gh-31295
2023-09-28 14:33:26 +02:00
Juergen Hoeller
38a0e17ede Prefer query(Class) method in javadoc example
See gh-26594
2023-09-28 14:33:20 +02:00
Stéphane Nicoll
b9bbfb79a4 Merge branch '6.0.x' 2023-09-28 09:32:28 +02:00
Stéphane Nicoll
6030e62766 Merge pull request #31330 from jihuayu
* pr/31330:
  Add missing `conversionService` field in doc example

Closes gh-31330
2023-09-28 09:32:20 +02:00
纪华裕
867b9f61b2 Add missing conversionService field in doc example
See gh-31330
2023-09-28 09:30:50 +02:00
Sam Brannen
515d8aae94 Merge branch '6.0.x' 2023-09-27 16:43:56 +02:00
Sam Brannen
6300fb37ad Include '?' for null-safe navigation in SpEL AST representations
Prior to this commit, if a Spring Expression Language (SpEL) expression
contained property, field, or method references using the null-safe
navigation operator (?.), the generated AST String representation
incorrectly omitted the '?' characters.

For example, 'myProperty?.myMethod()' had a generated AST string
representation of 'myProperty.myMethod()'.

This commit addresses this by introducing isNullSafe() in
MethodReference and reworking the logic in
CompoundExpression.toStringAST().

Closes gh-31326
2023-09-27 16:42:27 +02:00
Sam Brannen
0d22569422 Polishing 2023-09-27 16:34:18 +02:00
rstoyanchev
957b6b2caf Use URI String as fallback in ReactorClientHttpConnector
Closes gh-31033
2023-09-27 14:01:35 +01:00
Sam Brannen
47ed4e6c78 Merge branch '6.0.x' 2023-09-27 13:19:39 +02:00
Sam Brannen
06658c3c71 Restore zero capacity support in ConcurrentLruCache
Since the rewrite of ConcurrentLruCache in Spring Framework 6.0, an
attempt to create a ConcurrentLruCache with zero capacity results in an
IllegalArgumentException even though the documentation states that zero
capacity indicates "no caching, always generating a new value".

This commit restores the ability to configure a ConcurrentLruCache with
zero capacity and introduces corresponding tests (which were first
verified against the 5.3.x branch to ensure backward compatibility).

See gh-26320
Closes gh-31317
2023-09-27 13:18:30 +02:00