Commit Graph

3285 Commits

Author SHA1 Message Date
Sam Brannen
59c779d8fe Enforce order of Javadoc tags for records introduced in 6.2
See gh-33403
2024-08-18 13:12:47 +02:00
Juergen Hoeller
552936627a Reject method name mismatch in case of bean name overloading
Closes gh-33330
2024-08-13 18:22:34 +02:00
Simon Baslé
4dcdd9a224 Polishing
See gh-21590
2024-08-12 15:20:37 +02:00
Simon Baslé
2eda5d7a2a Handle low-level errors for sync/flux/mono/future gets
This change adds 3 protected methods to `AbstractCacheInvoker` that wrap
additional `Cache#retrieve` and `Cache#get` calls with
`handleCacheGetError` in case the Cache call itself fails.

For example, if the cache is remote and a connection to it cannot be
established.

Closes gh-21590
2024-08-12 15:02:05 +02:00
Simon Baslé
5e72ee36e2 Merge branch '6.1.x' 2024-08-12 14:54:54 +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
rstoyanchev
b61eee7fb0 Support cross-parameter validation
Closes gh-33271
2024-08-09 18:53:30 +03:00
Sam Brannen
3863b77536 Merge branch '6.1.x' 2024-08-08 14:20:56 +03: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
3b506e11a1 Polishing 2024-08-08 13:22:00 +03:00
Stéphane Nicoll
27aa341ab0 Merge branch '6.1.x' 2024-08-08 10:47:43 +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
Simon Baslé
71927b3487 Merge branch '6.1.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.java
2024-08-07 16:07:00 +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
0a2611b22f Harmonize NoUniqueBeanDefinitionException message
This commit makes sure that the programmatic exception that is thrown
by the cache abstraction uses the same message structure as a default
message produced by NoUniqueBeanDefinitionException.

Closes gh-33305
2024-08-02 16:24:43 +02:00
Simon Baslé
6174d95ba2 Add multi-unit DurationFormat.Style for duration parsing/printing
This adds the COMPOSITE style, which allows multiple segments each
similar to the SIMPLE style.

See gh-30396
Closes gh-33262
2024-07-30 16:58:42 +02:00
Stéphane Nicoll
1f2c6c33ac Merge branch '6.1.x' 2024-07-29 11:34:12 +02:00
Stéphane Nicoll
46ba13b645 Review Caching infrastructure documentation
Closes gh-33288
2024-07-29 11:29:35 +02:00
Juergen Hoeller
7c13d55906 Merge branch '6.1.x' 2024-07-29 10:48:11 +02:00
Juergen Hoeller
9d9e621efe Defensive singleton check for non-registered bean
Closes gh-33286
2024-07-29 10:47:08 +02:00
Stéphane Nicoll
2596e29013 Refine "Add AOT/Native support"
This commit review the support for AOT by only ignoring beans that are
using an instance supplier. The Kotlin DSL has a way to register a
bean by type where all inferences should happen as usual and that was
previously ignored.

This commit no longer ignores those beans so AOT can optimize them, and
makes sure that they are not registered again when running with AOT
optimizations. This change makes it so that the order in which beans are
registered is now different when running with AOT optimizations, and
we'll have to find a solution for that.

See gh-29555
2024-07-29 09:01:57 +02:00
Stéphane Nicoll
7c9bb24296 Polish 2024-07-24 13:59:06 +02:00
Stéphane Nicoll
b8f9913aa1 Add AOT/Native support
This commit adds AOT/Native support for beans that are contributed by
the Kotlin DSL.

Since they use an instance supplier, such beans are now configured to
be ignored by AOT generation. They are part of the bean factory still
so any hint generation works.

This commit removes a previous attempt at fixing this issue when we
were not checking for instance suppliers. Rather than skipping the
initializr at runtime, it runs again as intended since their state
can't be stored in AOT-generated code.

Closes gh-29555
2024-07-24 13:58:36 +02:00
Sam Brannen
4fa9781549 Ensure MapAccessor#canWrite only returns true for a Map target
Closes gh-33265
2024-07-23 18:26:53 +03:00
Sam Brannen
4684a17f00 Polishing 2024-07-23 18:21:12 +03:00
Simon Baslé
c92e043bbc Support multiple style of parsing/printing Durations
This commit introduces a notion of different styles for the formatting
of Duration.
The `@DurationFormat` annotation is added to ease selection of a style,
which are represented as DurationFormat.Style enum, as well as a
supported time unit represented as DurationFormat.Unit enum.

DurationFormatter has been retroffited to take such a Style,
optionally, at construction. The default is still the JDK style a.k.a.
ISO-8601.

This introduces the new SIMPLE style which uses a single number + a
short human-readable suffix. For instance "-3ms" or "2h".

This has the same semantics as the DurationStyle in Spring Boot and
is intended as a replacement for that feature, providing access to the
feature to projects that only depend on Spring Framework.

Finally, the `@Scheduled` annotation is improved by adding detection
of the style and parsing for the String versions of initial delay, fixed
delay and fixed rate.

See gh-22013
See gh-22474

Closes gh-30396
2024-07-23 11:56:48 +02:00
Stéphane Nicoll
92385418ae Polish assertion 2024-07-23 10:16:04 +02:00
Stéphane Nicoll
5331499393 Do not further process imports of Object.class
This commit filters out source classes that didn't pass a predicate
filter so that they are no longer considered.

Closes gh-27080
2024-07-22 12:31:02 +02:00
Stéphane Nicoll
5715b2a783 Fix javadoc references 2024-07-17 16:54:59 +02:00
Stéphane Nicoll
821109bd06 Polish "Add support for making MapAccessor read-only"
See gh-33222
2024-07-17 11:34:47 +02:00
Yanming Zhou
a0e43b1f46 Add support for making MapAccessor read-only
See gh-33222
2024-07-17 11:32:21 +02:00
Simon Baslé
50906e7fcb Merge branch '6.1.x' 2024-07-15 11:49:47 +02:00
Simon Baslé
6becfe2508 Fix AOP for Kotlin suspending function with aspect + @Cacheable
This change simplifies the CacheInterceptor way of dealing with cached
coroutines, thanks to the fact that lower level support for AOP has been
introduced in c8169e5c. This fix is similar to the one applied for
`@Transactional` in gh-33095.

Closes gh-33210
2024-07-15 11:47:12 +02:00
rstoyanchev
bd31e8dacc Provide access to underlying ConstraintViolation
Closes gh-33025
2024-07-12 17:35:35 +01:00
Juergen Hoeller
8cfdaaaabc Merge branch '6.1.x' 2024-07-10 15:57:24 +02:00
Juergen Hoeller
f2b3263fff Polishing 2024-07-10 15:56:56 +02:00
Juergen Hoeller
a9efe10428 Merge branch '6.1.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java
2024-07-10 15:16:40 +02:00
Juergen Hoeller
3ccaefe38f Polishing 2024-07-10 15:15:32 +02:00
rstoyanchev
9d45a8d512 Merge branch '6.1.x' 2024-07-09 06:54:56 +01:00
rstoyanchev
3008d97f93 Polishing contribution
Closes gh-33150
2024-07-09 06:53:14 +01:00
Sébastien NUSSBAUMER
f0c758498b Allow validation of Set method parameters
See gh-33150
2024-07-09 06:53:14 +01:00
Stéphane Nicoll
93587da394 Introduce ReflectiveScan
This commit allows `@Reflective` to be used on arbitrary types, not
only Spring beans. This makes the feature much more powerful as
components can be tagged directly.

Scanning happens during AOT processing (typically at build-time) when
`@ReflectiveScan` is used. Types do not need to have a particular
annotation, and types that can't be loaded are ignored.

This commit also exposes the infrastructure that does the scanning so
that custom code can do the scanning in an AOT contribution if they
don't want to rely on the annotation.

Closes gh-33132
2024-07-08 11:11:48 +02:00
Stéphane Nicoll
f1658079a5 Polish documentation for RegisterReflection
See gh-29194
2024-07-06 09:31:12 +02:00
Sam Brannen
c1f7d15c09 Merge branch '6.1.x' 2024-07-05 19:01:21 +02:00
Sam Brannen
83f7996c79 Polishing 2024-07-05 19:00:39 +02:00
Sam Brannen
8eb204b8dd Merge branch '6.1.x'
# Conflicts:
#	buildSrc/src/main/java/org/springframework/build/TestConventions.java
2024-07-04 17:05:38 +02:00
Sam Brannen
89338c91a9 Stop using using legacy locale data for Date/Time formatting tests
Commit 84714fbae9 introduced usage of the
-Djava.locale.providers=COMPAT command-line argument for javac in order
to allow our JDK 20 builds to pass by using legacy locale data.

That was done to ensure that Date/Time formats using AM/PM produced a
standard space (" ") before the "AM" or "PM" instead of a narrow
non-breaking space (NNBSP "\u202F"), which was introduced in Java 20
due to adoption of Unicode Common Locale Data Repository (CLDR-14032).

This commit removes usage of the -Djava.locale.providers=COMPAT
command-line argument and updates all affected tests to:

- Use an NNBSP before "AM" or "PM" in input text when running on Java 20
  or higher.

- Leniently match against any Unicode space character in formatted
  values containing "AM" or "PM".

See https://jdk.java.net/20/release-notes#JDK-8284840
See https://unicode-org.atlassian.net/browse/CLDR-14032
See gh-30185
Closes gh-33144
2024-07-04 17:03:15 +02:00
Simon Baslé
78d594c012 Merge branch '6.1.x' 2024-07-02 11:40:39 +02:00
zizare
8974da2a5a Use error handler for reactive cache aspect
This change ensures that the cache error handler is used in case of
future-based or publisher-based asynchronous caching completing with an
exception.

Closes gh-33073
2024-07-02 11:29:53 +02:00
Sam Brannen
932ce04541 Stop referring to old Spring versions in Javadoc 2024-07-01 17:50:52 +02:00