Commit Graph

29320 Commits

Author SHA1 Message Date
Sam Brannen
c6e6a3e44d Link to section in reference manual 2024-02-18 18:19:59 +01:00
Sam Brannen
bc2895a30b Support backticks for quoted identifiers in spring-r2dbc
NamedParameterUtils in spring-r2dbc now supports MySQL-style backticks
for quoted identifiers for consistency with spring-jdbc.

See gh-31944
Closes gh-32285
2024-02-17 16:05:40 +01:00
Sam Brannen
d86af57e0f Polishing 2024-02-17 16:00:58 +01:00
Sam Brannen
d4cde29f75 Clean up TODOs in SpEL 2024-02-17 15:33:05 +01:00
Sam Brannen
5f1e25a61f Polishing 2024-02-17 15:32:43 +01:00
Juergen Hoeller
0ddfe3977a Merge branch '6.1.x' 2024-02-16 22:50:04 +01:00
Juergen Hoeller
7bb9e85723 Avoid trivial static import 2024-02-16 22:43:56 +01:00
Juergen Hoeller
3aae7a66e6 Polishing 2024-02-16 22:27:09 +01:00
Juergen Hoeller
c6146ea2db Introduce shortcut for declared dependency name matching target bean name
Closes gh-28122
2024-02-16 21:28:04 +01:00
Sam Brannen
eefdee7983 Fix syntax in Selection/Projection examples 2024-02-16 18:44:28 +01:00
Sam Brannen
ab48ac36e9 Deprecate local variable support in SpEL's internal ExpressionState
Since the Spring Expression Language does not actually support local
variables in expressions, this commit deprecates all public APIs
related to local variables in ExpressionState (namely, the two
enterScope(...) variants that accept local variable data,
setLocalVariable(), and lookupLocalVariable()).

In addition, we no longer invoke `state.enterScope("index", ...)` in
the Projection and Selection AST nodes since the $index local variable
was never accessible within expressions anyway.

See gh-23202
Closes gh-32004
2024-02-16 18:29:00 +01:00
Sam Brannen
c1f0faade7 Polish ExpressionState 2024-02-16 18:25:14 +01:00
rstoyanchev
cd2a3fdd8d Remove deprecations in HandlerResult
See gh-30608
2024-02-16 16:16:08 +00:00
Sam Brannen
71dfebbfe5 Polishing 2024-02-16 16:45:18 +01:00
Sam Brannen
a85bf3185e Remove APIs deprecated for removal in 6.2
This commit removes the following obsolete and deprecated APIs.

- org.springframework.util.Base64Utils

- org.springframework.cache.jcache.interceptor.JCacheOperationSourcePointcut

- org.springframework.http.client.AbstractClientHttpResponse

- org.springframework.http.client.ClientHttpResponse.getRawStatusCode()

- org.springframework.http.client.observation.ClientHttpObservationDocumentation.HighCardinalityKeyNames.CLIENT_NAME

- org.springframework.web.reactive.function.client.ClientHttpObservationDocumentation.HighCardinalityKeyNames.CLIENT_NAME

- org.springframework.web.filter.reactive.ServerWebExchangeContextFilter.get(Context)

- org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler.handleBindException(...)

- org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver.handleBindException(...)

Closes gh-30608
2024-02-16 16:45:18 +01:00
Sam Brannen
6d5bf6d9b3 Ensure alias resolution in SimpleAliasRegistry depends on registration order
Closes gh-32024
2024-02-16 15:22:27 +01:00
Sam Brannen
6b482df6fa Clean up warning in Gradle build 2024-02-16 15:04:41 +01:00
Sam Brannen
ea4e7df9ca Consistently declare ignoreUnresolvablePlaceholders as last argument 2024-02-16 15:00:32 +01:00
Sam Brannen
7c07c43201 Polishing 2024-02-16 15:00:06 +01:00
Juergen Hoeller
6791ea94a0 Change executor phase to MAX_VALUE/2 and reduce timeout to 10 seconds
Closes gh-32152
2024-02-16 14:16:32 +01:00
Juergen Hoeller
7ee8e66c7f Avoid internal lifecycle synchronization in favor of lifecycle lock
Closes gh-32284
2024-02-16 12:42:39 +01:00
Juergen Hoeller
34372ee32b Introduce lock-based lifecycle waiting and default virtual threads flag
Closes gh-32252
2024-02-16 12:42:27 +01:00
Sam Brannen
b6df5a677e Polishing 2024-02-16 11:41:22 +01:00
Sam Brannen
fc9a118406 Polish SimpleCommandLinePropertySource support 2024-02-16 11:41:22 +01:00
Sam Brannen
87e6d1b7da Update Eclipse template to 6.2 2024-02-16 11:41:22 +01:00
Juergen Hoeller
ea3573176a Avoid infinite recursion for self-referencing generic type
Closes gh-32282
See gh-30079
2024-02-16 11:15:02 +01:00
Stéphane Nicoll
bcf235cc66 Merge branch '6.1.x' 2024-02-16 08:36:26 +01:00
Stéphane Nicoll
26ca7c49fb Merge pull request #32281 from kilink
* pr/32281:
  Update copyright year of changed files
  Use Spliterator of underlying collection

Closes gh-32281
2024-02-16 08:36:20 +01:00
Stéphane Nicoll
6b8105aef2 Update copyright year of changed files
See gh-32281
2024-02-16 08:33:17 +01:00
Patrick Strawderman
481283d2f1 Use Spliterator of underlying collection
Delegate to the spliterator method of the underlying collection in
MutablePropertyValues and MutablePropertySources. In both cases, those
collection types have specialized Spliterator implementations.
Delegating to these Spliterators also means the characteristics of the
Spliterator are properly set.

See gh-32281
2024-02-16 08:32:41 +01:00
Juergen Hoeller
7ad197e8e1 Deprecate LobHandler and SqlXmlHandler abstractions
Including SqlLobValue and related support classes.

Closes gh-32179
2024-02-15 17:26:49 +01:00
Juergen Hoeller
7e67da8a26 Support for matching partial generics
Closes gh-20727
2024-02-15 16:51:09 +01:00
Juergen Hoeller
d4e8daaede Add javadoc note on recursive resolution as of 6.2
See gh-30079
2024-02-15 16:50:53 +01:00
Yanming Zhou
e788aeb25b Improve GenericTypeResolver to resolve type variable recursively
Fix GH-24963
2024-02-15 16:28:45 +01:00
Stéphane Nicoll
4b2e40153a Merge pull request #32243 from ttddyy
* pr/32243:
  Polish "Add ThreadLocalAccessor for LocaleContext and RequestAttributes"
  Add ThreadLocalAccessor for LocaleContext and RequestAttributes

Closes gh-32243
2024-02-15 15:58:06 +01:00
Stéphane Nicoll
aef4b21f19 Polish "Add ThreadLocalAccessor for LocaleContext and RequestAttributes"
See gh-32243
2024-02-15 15:57:43 +01:00
Tadaya Tsuyukubo
5bd1c1fddb Add ThreadLocalAccessor for LocaleContext and RequestAttributes
Add `ThreadLocalAccessor` implementations:
- `LocaleThreadLocalAccessor`
- `RequestAttributesThreadLocalAccessor`

See gh-32243
2024-02-15 15:49:55 +01:00
Stéphane Nicoll
5d22aa9770 Add support for escaping prefix and separator in property placeholders
Closes gh-9628
Closes gh-26268
2024-02-15 15:28:36 +01:00
Stéphane Nicoll
e3aa5b6b11 Use new implementation in PropertyPlaceholderHelper
This commit removes the previous implementation in favor of the new
PlaceholderParser. The only noticeable side effect is that the exception
is no longer an IllegalArgumentException, but rather the dedicated
PlaceholderResolutionException.

See gh-9628
2024-02-15 15:27:13 +01:00
Stéphane Nicoll
00e05e603d Add new property placeholder implementation
This commit provides a rewrite of the parser for properties containing
potentially placeholders.

Assuming a source where `firstName` = `John` and `lastName` = `Smith`,
the "${firstName}-${lastName}" property is evaluated as "John-Smith".

Compared with the existing implementation in PropertyPlaceholderHelper,
the new implementation offers the following extra features:

1. Placeholder can be escaped using a configurable escape character.
When a placeholder is escaped it is rendered as is. This does apply to
any nested placeholder that wouldn't be escaped. For instance,
"\${firstName}" is evaluated as "${firstName}".
2. The default separator can also be escaped the same way. When the
separator is escaped, the left and right parts are not considered as
the key and the default value respectively. Rather the two parts
combined, including the separator (but not the escape separator) are
used for resolution. For instance, ${java\:comp/env/test} is looking
for a "java:comp/env/test" property.
3. Placeholders are resolved lazily. Previously, all nested placeholders
were resolved before considering if a separator was present. This
implementation only attempts the resolution of the default value if the
key does not provide a value.
4. Failure to resolve a placeholder are more rich, with a dedicated
PlaceholderResolutionException that contains the resolution chain.

See gh-9628
See gh-26268
2024-02-15 15:27:13 +01:00
Stéphane Nicoll
0fbfecd392 Merge pull request #31513 from bclozel
* pr/31513:
  Support "--" end of options in SimpleCommandLineArgsParser

Closes gh-31513
2024-02-15 15:09:39 +01:00
Brian Clozel
b4131ce131 Support "--" end of options in SimpleCommandLineArgsParser
Prior to this commit, the `SimpleCommandLineArgsParser` would reject
"--" arguments as invalid. As reported by the community, the POSIX
utility conventions (Guideline 10) state that

> The first -- argument that is not an option-argument should be
> accepted as a delimiter indicating the end of options.
> Any following arguments should be treated as operands, even if they
> begin with the '-' character.

This commit updates `SimpleCommandLineArgsParser` to not reject "--"
arguments and instead to consider remaining arguments as non-optional.

See gh-31513
2024-02-15 15:06:17 +01:00
Stéphane Nicoll
0f707706f1 Stop setting a thread name prefix for externally defined Executors
This commit updates the WebSocket message broker configuration to stop
setting a thread name prefix for externally defined Executors.

This used to apply to:

* clientInboundChannel with a thread name prefix of
"clientInboundChannel-".
* clientOutboundChannel with a thread name prefix of
"clientOutboundChannel-".
* brokerChannel with a thread name prefix of "brokerChannel-".

Closes gh-32132
2024-02-15 14:59:42 +01:00
Stéphane Nicoll
f526b23fd7 Harmonize WebSocket message broker to use Executor
This commit harmonizes the configuration of the WebSocket message
broker to use Executor rather than TaskExecutor as only the former
is enforced. This lets custom configuration to use a wider range
of implementations.

Closes gh-32129
2024-02-15 14:59:42 +01:00
Stéphane Nicoll
2fc8b13dd5 Add support for MySQL backticks
This commit makes sure that content within backticks are skipped
when parsing a SQL statement using NamedParameterUtils. This harmonizes
the current behavior of ignoring special characters that are wrapped
in backticks.

Closes gh-31944
2024-02-15 14:41:30 +01:00
Stéphane Nicoll
e73bbd4ad3 Configure jsonpath MappingProvider in WebTestClient
This commit improves jsonpath support in WebTestClient by detecting
a suitable json encoder/decoder that can be applied to assert more
complex data structure.

Closes gh-31653
2024-02-15 14:41:30 +01:00
Stéphane Nicoll
9f8038963f Allow JsonPathExpectationsHelper to use a custom configuration
This commit improves JsonPathExpectationsHelper to allow a custom json
path configuration to be defined. The primary objective of a custom
configuration is to specify a custom mapper that can deserialize complex
object structure.

As part of this commit, it is now possible to invoke a Matcher against
a type that holds generic information, using a regular
ParameterizedTypeReference.

Given that the existing constructor takes a vararg of Object, this
commit also deprecates this constructor in favor of formatting the
expression String upfront.

Closes gh-31651
2024-02-15 13:57:40 +01:00
Stéphane Nicoll
4f8eca1350 Order methods that take a type as a lambda consistently
Closes gh-32062
2024-02-15 13:57:17 +01:00
Stéphane Nicoll
18ea43c905 Allow customizations of embedded database connections
This commit allows EmbeddedDatabaseConfigurer instances to be further
customized if necessary. EmbeddedDatabaseBuilder has a way now to set
a DatabaseConfigurer rather than just a type to provide full control,
or customize an existing supported database type using the new
EmbeddedDatabaseConfigurers#customizeConfigurer callback.

Closes gh-21160
2024-02-15 13:46:49 +01:00
Stéphane Nicoll
bcccba50c1 Merge branch '6.1.x' 2024-02-15 13:07:47 +01:00