Commit Graph

30768 Commits

Author SHA1 Message Date
zinzo
a2cae4c8f4 Improve test coverage of StringUtils
This commit adds tests for `trimArrayElements()` and
`delimitedListToStringArray()` in StringUtils.

See gh-33298
2024-08-01 07:23:28 +02:00
Stéphane Nicoll
f63fc01d22 Merge branch '6.1.x' 2024-07-31 16:56:22 +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
rstoyanchev
31a3119784 Add FilterRegistration's defensively
Follow-up to d2225c, which broke Boot tests because the ServletContext can
be the one of the embedded Servlet container if initializing a live server
and as well as MockMvc (e.g. via `@AutoConfigureMockMvc`).

See gh-33252
2024-07-31 14:50:08 +03:00
Simon Baslé
f1a99cd968 Allow setting filename for inline elements in MimeMessageHelper
This change adds several overloads of `MimeMessageHelper#addInline`
which allow users to specify a file name for inline elements added from
an `InputStreamResource` or a `jakarta.activation.DataSource`.

Closes gh-33230
2024-07-31 11:39:16 +02:00
Stéphane Nicoll
c71f98acba Merge branch '6.1.x' 2024-07-30 17:21:28 +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
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
rstoyanchev
f967f6f9f0 Update contribution
Closes gh-33220
2024-07-30 13:15:21 +03:00
Seokjae Lee
5e9308e0cb Flexible collection handling in RequestParamArgumentResolver
See gh-33220
2024-07-30 11:42:44 +03:00
rstoyanchev
dbc69284c8 ResponseEntityExceptionHandler handles AsyncRequestNotUsableException
Closes gh-33225
2024-07-30 11:33:47 +03:00
rstoyanchev
5ac7e74bf2 Replace test FilterRegistration with the one in testFixtures
See gh-33252
2024-07-30 11:33:47 +03:00
rstoyanchev
24ab6f61de Add FilterRegistration to spring-web textFixtures
See gh-33252
2024-07-30 11:33:47 +03:00
rstoyanchev
d2225c2140 MockMvc supports FilterRegistration filter init
Closes gh-33252
2024-07-30 11:33:47 +03:00
Brian Clozel
38453910cd Add DatabaseClient bind variant for list of parameters
Prior to this commit, the `DatabaseClient` interface would allow batch
operations for binding parameters by their names and values. Positional
parameters did not have such equivalent.

This commit adds a new `bindValues(List<?>)` method variant for adding
multiple positional arguments in a single call and avoiding allocation
overhead when the parameters count is large.

Closes gh-33274
2024-07-29 14:07:15 +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
70f3b0eb91 Only register DynamicPropertySourceBeanInitializer if necessary
This commit makes sure to check first if
DynamicPropertySourceBeanInitializer has been registered before trying
to register it.

When running with AOT optimizations, the bean definition has been
contributed so there is no need to register it again when the context
customizer runs.

Closes gh-33272
2024-07-29 09:30:27 +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
Brian Clozel
b888f362e5 Document ControllerAdviceBean as internal usage
This commit documents `ControllerAdviceBean` as internal usage, as it is
not meant for application to manually create controller advice bean
instances.

This also refactors the existing partial implementation of the support
for creating controller advice beans "programmatically".

Closes gh-32776
2024-07-26 17:52:20 +02:00
Sam Brannen
94e2bef9a3 Merge branch '6.1.x' 2024-07-26 16:41:13 +03: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
de2335bee3 Merge branch '6.1.x' 2024-07-26 10:05:06 +02: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
sheip9
7a2fc2ff09 Fix reference to configurePathMatching in code sample
See gh-33277
2024-07-26 10:01:21 +02:00
Stéphane Nicoll
fc28926c15 Merge branch '6.1.x' 2024-07-25 16:29:07 +02:00
Stéphane Nicoll
52849819de Detect deprecation on enclosing classes as well
This commit improves CodeWarnings so that it detects if an enclosing
class is deprecated. Previously, it would only consider the annotated
element itself and the enclosing element is important for a class as
it is required to refer to it.

Closes gh-33273
2024-07-25 16:28:40 +02:00
Stéphane Nicoll
65faca8236 Consistently using credentials for creating the JMSContext
This commit updates UserCredentialsConnectionFactoryAdapter to apply
the same handling of credentials for creating the JMSContext.

Closes gh-33270
2024-07-25 09:41:43 +02:00
rstoyanchev
6e55e78b22 WebFlux support for SSE Fragment stream
See gh-33194
2024-07-24 15:34:13 +01:00
rstoyanchev
aa6b47bfce Polishing in FragmentsRendering
See gh-33194
2024-07-24 15:34:13 +01: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
Stéphane Nicoll
e741d6edbb Exclude bean definition from AOT processing using an attribute
This commits allows a particular bean definition to be excluded from
AOT processing using an attribute.

If BeanRegistrationAotProcessor#IGNORE_REGISTRATION_ATTRIBUTE is set
to `true`, then the bean definition is excluded. This complement the
existing BeanRegistrationExcludeFilter capability.

Closes gh-33243
2024-07-24 12:42:45 +02:00
Stéphane Nicoll
bbfc3364e1 Merge branch '6.1.x' 2024-07-24 11:45:49 +02:00
Stéphane Nicoll
bcdc991838 Switch to Shadow plugin fork
This commit fixes to a fork of the shadow plugin that fixes support
with recent Gradle releases.

See https://github.com/johnrengelman/shadow/pull/876
2024-07-24 11:42:54 +02:00
Stéphane Nicoll
589f17f48b Polish "Upgrade XJC processing to com.github.bjornvester.xjc"
See gh-33264
2024-07-24 11:42:25 +02:00
Sam Brannen
e547313fa6 Sync MapAccessor implementations 2024-07-23 18:27:52 +03: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
Brian Clozel
f3123d88f3 Merge branch '6.1.x' 2024-07-23 17:10:08 +02:00
Brian Clozel
9366308285 Fix Gradle warning in RuntimeHintsAgentPlugin
Fixing the following warning in the runtime hints plugin configuration:
https://docs.gradle.org/8.9/userguide/upgrading_version_8.html#test_task_default_classpath
2024-07-23 17:09:13 +02:00
Stéphane Nicoll
de002ec12a Merge branch '6.1.x' 2024-07-23 16:21:04 +02:00
Stéphane Nicoll
12b996b07d Upgrade XJC processing to com.github.bjornvester.xjc
This commit upgrades our build to use a different plugin for XJC
processing, so that Gradle doesn't output a compatibility warning
anymore.

Unfortunately, com.github.bjornvester.xjc only works against main
sources and our schema is only used for test purposes. This commit
therefore reconfigure the task to remove the xjc main source set and
apply it to the test source set instead.

Closes gh-33264
2024-07-23 16:19:30 +02:00
Stéphane Nicoll
7c558a3d6d Merge branch '6.1.x' 2024-07-23 15:07:21 +02:00
Stéphane Nicoll
656d08f075 Fix warning in doc generation 2024-07-23 15:06:59 +02: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
d219362eb1 Keep fallback flag in AOT-generated code
Closes gh-33261
2024-07-23 11:30:37 +02:00