Commit Graph

29780 Commits

Author SHA1 Message Date
Stéphane Nicoll 86761cd233 Upgrade to Reactor 2023.0.9
Closes gh-33326
2024-08-13 17:27:02 +02:00
Stéphane Nicoll 07cdef410e Upgrade to Micrometer 1.12.9
Closes gh-33325
2024-08-13 17:26:38 +02:00
Sam Brannen e74406afd0 Introduce withAssignmentDisabled() option for SimpleEvaluationContext
To support additional use cases, this commit introduces a
withAssignmentDisabled() method in the Builder for
SimpleEvaluationContext.

Closes gh-33319
2024-08-13 17:26:34 +03:00
rstoyanchev fe4fd00429 Polishing contribution
Closes gh-33374
2024-08-13 16:59:13 +03:00
Riley Park 1703b71563 Fix incorrect weak ETag assertion
See gh-33374
2024-08-13 16:31:14 +03:00
Sébastien Deleuze 1911ca728d Support invoking bridged suspending functions in AopUtils
Closes gh-33045
2024-08-12 17:27:41 +02:00
Simon Baslé f4a73b79b8 Avoid CacheAspectSupport#findInCaches fall through to reactive handler
Prior to this commit if the return type is a CompletableFuture but a
cache get returns null, the execution falls through to the
reactiveCachingHandler.

This commit ensures that evaluation instead continues onto the next
cache (if any).

Closes gh-33371
2024-08-12 14:54:15 +02:00
Stéphane Nicoll 289c35c829 Merge pull request #33368 from tafjwr
* pr/33368:
  Polish "Fix predicate setup in test"
  Fix predicate setup in test

Closes gh-33368
2024-08-12 11:02:02 +02:00
Stéphane Nicoll 749145be2a Polish "Fix predicate setup in test"
See gh-33368
2024-08-12 10:29:34 +02:00
tafjwr 28eece3da1 Fix predicate setup in test
See gh-33368
2024-08-12 10:29:23 +02:00
Stéphane Nicoll 2b8225f11c Polish "Sync GHA setup" 2024-08-09 15:52:27 +02:00
Stéphane Nicoll 1e6767ac03 Sync GHA setup 2024-08-09 15:37:43 +02:00
Stéphane Nicoll 7a250aa8ea Polish
See gh-33354
2024-08-09 09:52:06 +02:00
Stéphane Nicoll 21bc8726d6 Merge pull request #33354 from GoncaloPT
* pr/33354:
  Polish "Fix error codes in Customizing Validation Errors section"
  Fix error codes in Customizing Validation Errors section

Closes gh-33354
2024-08-09 09:04:34 +02:00
Stéphane Nicoll df7ac9b308 Polish "Fix error codes in Customizing Validation Errors section"
See gh-33354
2024-08-09 09:03:05 +02:00
Gonçalo Silva 43217bdf06 Fix error codes in Customizing Validation Errors section
See gh-33354
2024-08-09 09:02:53 +02:00
Robert Danczak a31945f8b6 Fix syntax error in RestClient documentation
Closes gh-33350
2024-08-08 17:15:27 +03:00
Simon Baslé a0edf129eb Fix misleading statement in ReactorResourceFactory javadoc
Closes gh-33338
2024-08-08 15:26:10 +02:00
Sam Brannen bcffa15c7d Reinstate qualifier support for JSR-330 @⁠javax.inject.Named
This commit revises QualifierAnnotationAutowireCandidateResolver to
reinstate "qualifier" support for the legacy JSR-330
@⁠javax.inject.Named annotation.

See gh-31090
Closes gh-33345
2024-08-08 14:20:06 +03:00
Sam Brannen f9d2641fd5 Update field name to reflect switch to Jakarta 2024-08-08 13:22:00 +03:00
Sam Brannen 3b506e11a1 Polishing 2024-08-08 13:22:00 +03:00
Stéphane Nicoll ddee309e11 Merge pull request #33341 from pcvolkmer
* pr/33341:
  Add missing Kotlin example for expectAll()

Closes gh-33341
2024-08-08 11:41:48 +02:00
Paul-Christian Volkmer 7e4884fcfa Add missing Kotlin example for expectAll()
See gh-33341
2024-08-08 11:35:12 +02:00
Jonatan Ivanov 38a3d18256 Start Observation before scope open for Scheduled operation
When ScheduledAnnotationReactiveSupport adds the Observation to the
context, Reactor opens a scope through the Context Propagation API.
This happens before TrackingSubscriber would start the Observation and
opening a scope without starting an Observation is invalid.

This change moves the Observation start before the scope opening.

Closes gh-33349
2024-08-08 10:46:19 +02:00
Jonatan Ivanov 6c74fee5e8 Remove unnecessary error signal from DefaultRestClient
Before UnknownContentTypeException is thrown, it is added to the current
Observation but since UnknownContentTypeException is a
RestClientException, the exception is added again in one of the
catch blocks later on.

Closes gh-33347
2024-08-08 09:30:22 +02:00
Jonatan Ivanov 36e84a5209 Fix RestClient instrumentation
ClientHttpResponse implements Closeable and the close method of
DefaultConvertibleClientHttpResponse also stops the current Observation.

Before this change exiting the try-with-resource block stopped the
Observation since it called close on ClientHttpResponse.
After this, there were multiple error and stop calls on the Observation
in the catch blocks after the Observation was already stopped
which is invalid.

This change reorders the flow by stopping the Observation in the
finally block (closing ClientHttpResponse) and not stopping
the Observation in any of the catch blocks.

Closes gh-33346
2024-08-08 09:11:57 +02:00
Sam Brannen 1e97b2137b Disable class data sharing (CDS) for tests
Prior to this commit, the Gradle build output the following warning
multiple times.

OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Since we don't need CDS enabled for our tests, I've added `-Xshare:off`
as a JVM argument for our tests to disable CDS.

(cherry picked from commit 27985b1439)
2024-08-07 18:08:03 +03:00
Sam Brannen 5e4e530c59 Remove Java 21 classpath entries in Eclipse projects
Since the me.champeau.mrjar stores Java 21 main and test sources in
non-standard locations, and since we can only use a single JDK within
Eclipse, this commit updates `ide.gradle` to remove `java21` classpath
entries in Eclipse projects.
2024-08-07 18:02:43 +03:00
Stéphane Nicoll 76b2d13b2c Add support for changing context path in ServletRequestPath
This commit implements modifyContextPath in ServletRequestPath and
apply the same logic of concatenating the servlet path with the
context path.

Closes gh-33251
2024-08-07 16:28:17 +02:00
Aleksey Genus 9b85a246d8 SimpleAsyncTaskScheduler stops accepting new tasks when isShutdown
This changes the criteria for simplified task rejection logging from
to be that the executor is in the shutdown phase, not fully terminated.

See gh-33334
Closes gh-33336
2024-08-07 15:58:27 +02:00
Stéphane Nicoll 5a99407847 Start building against Reactor 2023.0.9 snapshots
See gh-33326
2024-08-07 10:02:20 +02:00
Stéphane Nicoll 05bd246cab Start building against Micrometer 1.12.9 snapshots
See gh-33325
2024-08-07 10:01:54 +02:00
Sam Brannen 0127de5a7a Enforce read-only semantics in SpEL's SimpleEvaluationContext
SimpleEvaluationContext.forReadOnlyDataBinding() documents that it
creates a SimpleEvaluationContext for read-only access to public
properties; however, prior to this commit write access was not disabled
for indexed structures when using the assignment operator, the
increment operator, or the decrement operator.

In order to better align with the documented contract for
forReadOnlyDataBinding(), this commit makes it possible to disable
assignment in general in order to enforce read-only semantics for
SpEL's SimpleEvaluationContext when created via the
forReadOnlyDataBinding() factory method. Specifically:

- This commit introduces a new isAssignmentEnabled() "default" method
  in the EvaluationContext API, which returns true by default.

- SimpleEvaluationContext overrides isAssignmentEnabled(), returning
  false if the context was created via the forReadOnlyDataBinding()
  factory method.

- The Assign, OpDec, and OpInc AST nodes -- representing the assignment
  (=), increment (++), and decrement (--) operators, respectively --
  now throw a SpelEvaluationException if assignment is disabled for the
  current EvaluationContext.

Closes gh-33319
2024-08-06 13:54:11 +03:00
Sam Brannen fcc99a67b6 Support lists for varargs invocations in SpEL
The changes made in conjunction with gh-33013 resulted in a regression
for varargs support in SpEL expressions. Specifically, before gh-33013
one could supply a list -- for example, an "inline list" -- as the
varargs array when invoking a varargs constructor, method, or function
within a SpEL expression. However, after gh-33013 an inline list (or
collection in general) is no longer converted to an array for varargs
invocations. Instead, the list is supplied as a single argument of the
resulting varargs array which breaks applications that depend on the
previous behavior.

Although it was never intended that one could supply a collection as
the set of varargs, we concede that this is a regression in existing
behavior, and this commit therefore restores support for supplying a
java.util.List as the varargs "array".

In addition, this commit introduces the same "list to array" conversion
support for MethodHandle-based functions that accept varargs.

Note, however, that this commit does not restore support for converting
arbitrary single objects to an array for varargs invocations if the
single object is already an instance of the varargs array's component
type.

See gh-33013
Closes gh-33315
2024-08-05 16:28:11 +03:00
Sam Brannen 8afff3359b Polishing 2024-08-05 15:01:41 +03:00
Sam Brannen c57c2272a1 Throw exception for failure to set property as index in SpEL
Prior to this commit, the Indexer in the Spring Expression Language
(SpEL) silently ignored a failure to set a property via the indexed
property syntax (['<property name>'] = <new value>) – for example, if
property write access was disabled in the EvaluationContext.

This commit addresses this issue by properly throwing a
SpelEvaluationException in PropertyIndexingValueRef.setValue(Object) if
the property could not be set.

Closes gh-33310
2024-08-05 14:15:55 +03:00
Sam Brannen 8ec23a0fcc Polishing 2024-08-05 14:15:39 +03:00
Sam Brannen 8badae9d72 Convert primitive array to Object[] when invoking varargs method in SpEL
Prior to this commit, SpEL incorrectly wrapped a primitive array in an
Object[] array when invoking Object[] varargs methods and constructors.

This commit addresses this by updating the convertArguments(...) method
in ReflectionHelper as follows when the user supplies the varargs
already packaged in a primitive array.

- When deciding whether to convert a single element passed as varargs,
  we now check if the argument is an array that is assignable to the
  varargs array type.

- When converting an array supplied as the varargs, we convert that
  array to the varargs array type.

Closes gh-33317
2024-08-05 11:56:48 +03:00
Sam Brannen 444e7eeb74 Enable test for primitive array to Object[] conversion in SpEL
See gh-33212
2024-08-05 11:05:53 +03:00
Sam Brannen cb6a5baac5 Support conversion from primitive array to Object[] in ConversionService
Prior to this commit, the ConversionService failed to convert a primitive
array (such as int[]) to an Object[] due to an error in the logic in
ArrayToArrayConverter.

This commit addresses this by augmenting the "can bypass conversion"
check in ArrayToArrayConverter to ensure that the supplied source object
is an instance of the target type (i.e., that the source array can be
cast to the target type array without conversion).

Closes gh-33212
2024-08-04 17:13:56 +03:00
Stéphane Nicoll 3b2a818f1e Upgrade to Java 17.0.12 2024-08-04 09:34:13 +02:00
Stéphane Nicoll 84d1122190 Shorten CI and deploy snapshot jobs to 60 minutes
Closes gh-33302
2024-08-02 10:56:25 +02:00
Simon Baslé 722dcae1b1 Fix buffer leak in MultipartParser
This change fixes a buffer leak when the MultipartParser is encountering
a body DataBuffer that only contains a boundary.

Closes gh-33094
2024-08-01 16:28:50 +02:00
Stéphane Nicoll 850a0de1b0 Suppress deprecated warnings for autowiring
This commit extends our handling of deprecated with AOT to autowiring.

Closes gh-33295
2024-07-31 16:51:06 +02:00
Stéphane Nicoll 321e8a58ae Document that NoOpResponseErrorHandler is not a good fit with RestClient
Closes gh-33276
2024-07-30 17:17:39 +02:00
Stéphane Nicoll 46ba13b645 Review Caching infrastructure documentation
Closes gh-33288
2024-07-29 11:29:35 +02:00
Juergen Hoeller 9d9e621efe Defensive singleton check for non-registered bean
Closes gh-33286
2024-07-29 10:47:08 +02:00
Sam Brannen 5aa38833dd Fix XJC configuration to re-enable Eclipse IDE support
Our recent switch from the `org.unbroken-dome.xjc` plugin to the
`com.github.bjornvester.xjc` plugin resulted in errors when trying to
import Spring Framework projects into the Eclipse IDE.

This commit fixes those issues as follows.

- @wilkinsona revised the XJC configuration in `spring-oxm.gradle` to
  avoid the ConcurrentModificationException encountered when running
  `./gradlew eclipse`.

- I added a workaround in `ide.gradle` to manually remove lingering
  "main" classpath entries for sources generated by XJC.

Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>

Closes gh-33264
2024-07-26 16:39:40 +03:00
Stéphane Nicoll 9aac24c18a Merge pull request #33277 from sheip9
* pr/33277:
  Polish "Fix reference to configurePathMatching in code sample"
  Fix reference to configurePathMatching in code sample

Closes gh-33277
2024-07-26 10:02:50 +02:00
Stéphane Nicoll ea665d776d Polish "Fix reference to configurePathMatching in code sample"
See gh-33277
2024-07-26 10:01:39 +02:00