Commit Graph

29503 Commits

Author SHA1 Message Date
Sam Brannen
6461eec582 Revise contribution
Closes gh-32380
2024-03-06 11:49:21 +01:00
Yanming Zhou
be136d79ee Improve Javadoc for NamedParameterUtils.substituteNamedParameters()
This commit documents that an empty list is not guaranteed to be
supported by the database. For example, MySQL and PostgreSQL do not
support `foo in ()`.

See gh-32380
2024-03-06 11:49:15 +01:00
Sam Brannen
9eea768205 Polish SpEL internals 2024-03-06 11:31:10 +01:00
Simon Baslé
19b5f11734 Merge branch '6.1.x' 2024-03-05 18:33:48 +01:00
Simon Baslé
988f3630c4 Avoid duplicate upstream subscription during reactive cache put
This commit fixes an issue where a Cacheable method which returns a
Flux (or multi-value publisher) will be invoked once, but the returned
publisher is actually subscribed twice.

By using the Reactor `tap` operator, we ensure that we can emit values
downstream AND accumulate emitted values into the List with a single
subscription.

The SignalListener additionally handles scenarios involving cancel,
for instance in case of a `take(1)` in the chain. In that case values
emitted up until that point will have been stored into the List buffer,
so we can still put it in the cache. In case of error, no caching occurs
and the internal buffer is cleared. This implementation also protects
against competing onComplete/onError signals and cancel signals.

Closes gh-32370
2024-03-05 18:32:32 +01:00
Juergen Hoeller
6f7f032ced Merge branch '6.1.x' 2024-03-05 18:24:01 +01:00
Juergen Hoeller
a0ae849856 Polishing 2024-03-05 18:23:13 +01:00
Juergen Hoeller
7d4c8a403e Introduce configurable default rollback rules
Includes rollbackOn annotation attribute on @EnableTransactionManagement and addDefaultRollbackRule method on AnnotationTransactionAttributeSource, as well as publicMethodsOnly as instance-level flag (also on AnnotationCacheOperationSource).

Closes gh-23473
2024-03-05 18:08:08 +01:00
ali dandach
eb01cc0d9d Use String#isEmpty where feasible
This commit replaces checks for empty strings ("".equals(...)) with the
String#isEmpty method.

Closes gh-32377
2024-03-05 17:38:29 +01:00
Juergen Hoeller
30e75e4a09 Enable efficient pointcut checks for composite sources as well
Closes gh-20072
2024-03-05 13:34:48 +01:00
Sam Brannen
1fa6ac30b5 Remove unused lastReadInvokerPair field in ReflectivePropertyAccessor 2024-03-05 12:55:30 +01:00
rstoyanchev
ddab971fca Merge branch '6.1.x' 2024-03-05 11:42:17 +00:00
rstoyanchev
ef0717935b Test wrapping of response for async request
The following adjustments are also made as a result:
- Use int to check if lock is held and unlock is needed, given that
for non-async requests we don't need to obtain a lock.
- Protect access methods getOutputStream and getWriter with the
same locking and state checks.

Closes gh-32340
2024-03-05 11:42:03 +00:00
rstoyanchev
822e2447a0 Polishing StandardServletAsyncWebRequestTests
See gh-32340
2024-03-05 11:42:03 +00:00
Sam Brannen
b44c31e997 Polishing 2024-03-05 12:01:55 +01:00
Sam Brannen
1ea593e777 Convert PropertyCacheKey to a record 2024-03-05 12:01:55 +01:00
Sam Brannen
70a545e13a Use appropriate variable names in ReflectivePropertyAccessor 2024-03-05 11:52:30 +01:00
Sam Brannen
c29c67839b Cache parameterTypes in ClassUtils.getInterfaceMethodIfPossible 2024-03-05 11:48:01 +01:00
Sébastien Deleuze
f6dfbac582 Merge branch '6.1.x' 2024-03-05 11:01:29 +01:00
Sébastien Deleuze
cfd0aee4db Polish and add MockMvcExtensionsTests.queryParameter
Closes gh-32371
2024-03-05 10:59:12 +01:00
corby kim
132fbe228f Add query parameters to MockMvc Kotlin DSL
See gh-32371
2024-03-05 10:56:41 +01:00
Arjen Poutsma
6d9aba88d0 Fix typo
See gh-32360
2024-03-05 10:48:06 +01:00
Sébastien Deleuze
db826551a6 Upgrade to Dokka 1.9.20
Closes gh-32374
2024-03-05 10:31:29 +01:00
Arjen Poutsma
646bd7f893 Document StringUtils::uriDecode limitations
Closes gh-32360
2024-03-05 10:03:15 +01:00
ali dandach
1cb2dfa459 enh: use isEmpty() instead of length() 2024-03-04 23:55:33 +01:00
Juergen Hoeller
79c54098ab Merge branch '6.1.x' 2024-03-04 23:49:55 +01:00
Juergen Hoeller
4300fec023 Restore ability to return original method at ClassUtils level as well
Closes gh-32365
2024-03-04 23:48:26 +01:00
Juergen Hoeller
dc6c96de0a Merge branch '6.1.x'
# Conflicts:
#	spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractFallbackJCacheOperationSource.java
#	spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java
#	spring-tx/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java
2024-03-04 22:50:22 +01:00
Juergen Hoeller
e9110c0729 Polishing 2024-03-04 22:48:52 +01:00
Juergen Hoeller
24759a75f4 Restore ability to return original method for proxy-derived method
Closes gh-32365
2024-03-04 22:48:46 +01:00
Juergen Hoeller
b5ca646431 Leniently tolerate late bean retrieval during destroySingletons()
Closes gh-22526
Closes gh-29730
2024-03-04 17:21:02 +01:00
Sébastien Deleuze
138e7a0e07 Use ServletResponse#getContentType in ServletServerHttpResponse
This commit updates ServletServerHttpResponse.ServletResponseHttpHeaders
in order to use ServletResponse#getContentType instead of
ServletResponse#getHeader.

It allows to have a consistent behavior between Tomcat (which sets only
the former) and Undertow/Jetty (which set both).

Closes gh-32339
2024-03-04 15:32:32 +01:00
Sébastien Deleuze
4ce2559980 Merge branch '6.1.x' 2024-03-04 14:43:18 +01:00
Sébastien Deleuze
7493ce86b6 Fix ServletResponseHttpHeaders#get null handling
ServletResponseHttpHeaders#get should be annotated with `@Nullable` and
return null instead of a singleton list containing null when there is no
content type header.

Closes gh-32362
2024-03-04 14:43:09 +01:00
Sébastien Deleuze
ce9dc19a3c Optimize content type parsing
This commit avoids calling HttpHeaders#getContentType multiple times in
ServletServerHttpResponse#writeHeaders.

Closes gh-32361
2024-03-04 14:43:09 +01:00
rstoyanchev
1c5bb732b9 Merge branch '6.1.x' 2024-03-04 13:36:30 +00:00
rstoyanchev
4b96cd28c0 Add locking in ServletResponse#flushBuffer
In addition to using the ServletOutputStream, it's also possible to call
ServletResponse#flushBuffer, so the ServletOutputStream wrapper logic needs
to apply there as well.

See gh-32340
2024-03-04 13:35:46 +00:00
Juergen Hoeller
3d7ef3ebfc Avoid storage of null marker per method for proxy decision purposes
Includes missing isCandidateClass support on JCacheOperationSource.

Closes gh-20072
2024-03-04 12:55:33 +01:00
Sébastien Deleuze
219004ef13 Merge branch '6.1.x' 2024-03-03 22:26:37 +01:00
Sébastien Deleuze
516a203703 Support nullable Kotlin value class arguments
This commit skips the value class parameter instantiation for nullable
types when a null argument is passed.

Closes gh-32353
2024-03-03 22:26:21 +01:00
rstoyanchev
0758c8b14c Merge branch '6.1.x' 2024-03-03 20:53:36 +00:00
rstoyanchev
877e0b1483 Improve concurrent handling of result in WebAsyncManager
1. Use state transitions
2. Increase synchronized scope in setConcurrentResultAndDispatch

See gh-32340
2024-03-03 20:44:52 +00:00
rstoyanchev
379ffac508 Add state and response wrapping to StandardServletAsyncWebRequest
The wrapped response prevents use after AsyncListener onError or completion
to ensure compliance with Servlet Spec 2.3.3.4.

The wrapped response is applied in RequestMappingHandlerAdapter.

The wrapped response raises AsyncRequestNotUsableException that is now
handled in DefaultHandlerExceptionResolver.

See gh-32340
2024-03-03 20:44:36 +00:00
Sam Brannen
4a6dbb17f4 Merge branch '6.1.x' 2024-03-03 14:51:01 +01:00
Sam Brannen
380184e85a Support SpEL compilation of #root or #this with non-public type
Prior to this commit, if a Spring Expression Language (SpEL) expression
referenced the root context object via the #root or #this variable, we
inserted a checkcast in the generated byte code that cast the object to
its concrete type. However if the root context object's type was
non-public, that resulted in an IllegalAccessError when the compiled
byte code was executed.

VariableReference.getValueInternal() already contains a solution for
global variables which inserts a checkcast to Object in the generated
byte code instead of to the object's concrete non-public type.

This commit therefore applies the same logic to #root (or #this when
used to reference the root context object) that is already applied to
global variables.

Closes gh-32356
2024-03-03 14:49:42 +01:00
Sam Brannen
a29c84f663 Merge branch '6.1.x' 2024-03-02 18:08:27 +01:00
Sam Brannen
5cba32df32 Polish SpEL's VariableReference 2024-03-02 18:03:44 +01:00
Sam Brannen
11c40b5c1c Restructure SpEL indexer compilation tests 2024-03-02 18:03:44 +01:00
Juergen Hoeller
390fe0fe78 Add support for resolving multiple bounds in type variables
Closes gh-22902
See gh-32327
2024-03-02 11:30:17 +01:00
Stéphane Nicoll
ac1a030c35 Make PlaceholderResolutionException extend from IllegalArgumentException
To smooth upgrade from 6.1.x, this commit makes sure that code that used
to catch an IAE to ignore a faulty placeholder resolution still works.

See gh-9628
2024-03-02 08:28:38 +01:00