Commit Graph

29475 Commits

Author SHA1 Message Date
Stéphane Nicoll 4d34444a69 Consistent annotation lookup in MvcUriComponentsBuilder
Previously, a UriComponents build based on a method would require the
given method to be the annotated one as method parameter resolution only
applied locally. This was a problem when a controller was specified on
a method whose mapping is defined in a parent.

This commit harmonies the lookup using AnnotatedMethod who provides
support for a synthesized method parameter that takes annotations from
parent parameter into account.

Closes gh-32553
2024-04-23 15:21:27 +02:00
Juergen Hoeller d4ddbd537b Polishing 2024-04-23 13:16:33 +02:00
Juergen Hoeller 0b9b9b4602 Avoid overreading of InputStream in copyRange
Closes gh-32695
2024-04-23 13:16:28 +02:00
Stéphane Nicoll 40596d444c Provide a more explicit link to URI composition examples
Closes gh-32685
2024-04-23 12:43:15 +02:00
Stéphane Nicoll cb5b9dcaed Document AOT limitation of creating beans with custom arguments
Closes gh-32690
2024-04-23 11:03:28 +02:00
Stéphane Nicoll c99e7f8616 Ignore InstanceSupplier for getBean with arguments
Previously, a BeanDefinition that has an instance supplier would be
used irrespective of custom arguments being provided. This commit only
applies the instance supplier if no arguments are provided. With
custom arguments, the regular lookup takes place based on the
information provided in the bean factory.

Closes gh-32657
2024-04-22 16:59:31 +02:00
Stéphane Nicoll 8a8c8fe00e Detect target of factory method with AOT
Previously, if a factory method is defined on a parent, the generated
code would blindly use the method's declaring class for both the target
of the generated code, and the signature of the method.

This commit improves the resolution by considering the factory metadata
in the BeanDefinition.

Closes gh-32609
2024-04-22 15:13:56 +02:00
Stéphane Nicoll f45e7b9b9b Relax scope of DataIntegrityViolationException
This commit updates the Javadoc of DataIntegrityViolationException to
broaden its scope as it was too specific before.

Closes gh-32631
2024-04-22 14:49:17 +02:00
Juergen Hoeller ec1f5ca600 Polishing 2024-04-22 13:43:07 +02:00
Juergen Hoeller 62efdfb89c Try early initialization for all user-declared methods (including interfaces)
Closes gh-32682
2024-04-22 13:43:02 +02:00
Stéphane Nicoll c3da43291b Upgrade to Java 17.0.11 2024-04-22 12:13:01 +02:00
Brian Clozel 5aa576f5c6 Register status handler exceptions in observations
Prior to this commit, `RestClientException` thrown by status handlers
would not be registered as observation errors. This commit ensures that
such exceptions are first caught, registered in the observation and
rethrown as expected.

Closes gh-32575
2024-04-20 19:44:11 +02:00
Brian Clozel 0268180799 Rethrow unhandled JMS listener exceptions
Fixes gh-32666
2024-04-18 21:44:44 +02:00
Brian Clozel da4547a27e Extend observations to RestClient ResponseSpec
Prior to this commit, the `RestClient` observations would be stopped as
soon as the exchange function was called. This means that all errors
related to response decoding or mapping would not be recorded by the
obsevations.

This commit extends the observation recording to the `ResponseSpec` DSL
calls as well as custom exchange functions.

Fixes gh-32575
2024-04-18 21:26:18 +02:00
rstoyanchev 97eddb769a Avoid duplicate subscriptionId's in destinationCache
Closes gh-32625
2024-04-18 14:18:30 +01:00
Juergen Hoeller 0e0397a385 Polishing 2024-04-18 12:18:18 +02:00
Juergen Hoeller fec4f9b8cb Add test for pre-resolved target type on RootBeanDefinition
See gh-32649
2024-04-18 12:17:17 +02:00
Juergen Hoeller 4e20cdeb43 Expand comment on participation in existing transaction
Closes gh-32659
2024-04-18 12:16:33 +02:00
yhao3 7f27ba3902 Update links to HttpOnly documentation at OWASP in ResponseCookie
Closes gh-32663
2024-04-18 11:52:50 +02:00
Brian Clozel b3a45670f9 Do not set 0 Content-Length header in BufferingClientHttpRequestFactory
Prior to this commit, the `BufferingClientHttpRequestFactory`, through
the `AbstractBufferingClientHttpRequest`, would set a "Content-Length"
header value, even if the buffered body was empty.

This behavior is invalid since no request body would be set by the
client code in the first place.

This commit ensures that this header is only set if a request body has
been buffered and is about to be written to the request.

Fixes gh-32650
2024-04-17 22:44:36 +02:00
xumengqi 8ec27438e7 Fix transaction definition setTimeout error message since zero is valid
This commit rephrases the `DefaultTransactionDefinition#setTimeout`
exception message to better reflect the fact that 0 is a valid input
value.

Even though this often leads to a transaction immediately timing out
after opening, there is one notable case where this has another
meaningful effect: in Jakarta transactions (`UserTransaction`), when
passing 0 "the transaction service restores the default value".

Closes gh-32635
2024-04-16 16:39:23 +02:00
xumengqi bf3278596c Include actual cause's message in various parsing exception messages
This change improves the message of several parsing-related exceptions
that would previously entirely swallow the original exception's message
and sometimes have a slightly misleading message as a result.

This is done by appending the cause's `toString` representation to the
IllegalArgumentException messages instead of an hardcoded "cause".

Closes gh-32636
2024-04-16 16:25:42 +02:00
Arjen Poutsma 3971632415 Reintroduce SimpleClientHttpRequestFactory limitations
Closes gh-32641
2024-04-16 11:43:09 +02:00
Simon Baslé 1e54916119 Ensure multipart data is deleted in WebFlux when connection terminates
Before this change temporary files would not consistently be deleted
when the connection which uploads the multipart files closes naturally.

This change uses the usingWhen Reactor operator to ensure that the
termination of the connection doesn't prevent individual file parts
from being deleted due to a cancellation signal.

Closes gh-31217
2024-04-15 14:20:48 +02:00
Brian Clozel 6e20af41bf Upgrade CI image to Java 23ea17 2024-04-11 11:32:48 +02:00
Spring Builds c68c62b6c6 Next development version (v6.1.7-SNAPSHOT) 2024-04-11 08:26:17 +00:00
Brian Clozel 494ed4e852 Refine UriComponentsBuilder parsing
This commit refines the expressions for the scheme, user info, host and
port parts of the URL in UriComponentsBuilder to better conform to
RFC 3986.

Fixes gh-32616
2024-04-11 08:49:11 +02:00
Juergen Hoeller 39cd31613b Polishing 2024-04-10 18:06:32 +02:00
Sébastien Deleuze ca2b3c170c Add Kotlin hints for enclosing class
This is needed by Kotlin reflection in order to be able to list
class members on native.

Closes gh-32472
2024-04-10 17:53:12 +02:00
Brian Clozel 019ce4418c BufferingClientHttpRequestWrapper should not write empty body
Prior to this commit, `BufferingClientHttpRequestWrapper` would always
write to the actual client request body, even if the buffered content
was empty (empty byte array).
This would cause issues with specific client request factories,
especially the OkHttp variant, that would consider empty byte arrays as
non-empty body and would reject such cases for GET requests with an
"IllegalArgumentException: method GET must not have a request body".

This commit only writes to the request if the buffered content is not
empty.

Fixes gh-32612
2024-04-10 16:41:16 +02:00
Stéphane Nicoll a0136a276a Upgrade to Reactor 2023.0.5
Closes gh-32592
2024-04-09 19:51:08 +02:00
rstoyanchev 8d05028c2e RequestParam resolver supports empty array suffix
Closes gh-32577
2024-04-09 18:24:57 +01:00
rstoyanchev 4a68c44a27 Update content-length when reconstructing body
Closes gh-32471
2024-04-09 18:24:57 +01:00
Sam Brannen e702733c7b Detect bridge methods across ApplicationContexts in MethodIntrospector
Prior to this commit, MethodIntrospector failed to properly detect
bridge methods for subsequent invocations of selectMethods() with the
same targetType and MetadataLookup, if such subsequent invocations
occurred after the ApplicationContext had been refreshed.

The reason this occurs is due to the following.

- Class#getDeclaredMethods() always returns "child copies" of the
  underlying Method instances -- which means that `equals()` should be
  used instead of `==` whenever the compared Method instances can come
  from different sources (such as the static caches mentioned below).

- BridgeMethodResolver caches resolved bridge methods in a static cache
  -- which is never cleared.

- ReflectionUtils caches declared methods in a static cache
  -- which gets cleared when an ApplicationContext is refreshed.

Consequently, if you attempt to load an ApplicationContext twice in the
same ClassLoader, the second attempt uses the existing, populated cache
for bridged methods but a cleared, empty cache for declared methods.
This results in new invocations of Class#getDeclaredMethods(), and
identity checks with `==` then fail to detect equivalent bridge methods.

This commit addresses this by additionally comparing bridge methods
using `equals()` in MethodIntrospector.selectMethods().

Note that the `==` checks remain in place as an optimization for when
`equals()` is unnecessary.

Closes gh-32586
2024-04-09 18:56:41 +02:00
Sam Brannen 187f641409 Polishing 2024-04-09 18:55:39 +02:00
Brian Clozel ac74116d76 Instrument JmsTemplate#sendAndReceive
Prior to this commit, the `JmsTemplate#sendAndReceive` method would not
instrument the JMS session. This means that no metric would be recorded
when sending the message and no trace would be propagated downstream.

This commit ensures that the JMS session is instrumented in this case as
well. Note, the reception of the response message does not create a
`"jms.message.process"` observation as the session is only receiving the
message, no listener has been configured on the message consumer.

Fixes gh-32606
2024-04-09 18:34:09 +02:00
Juergen Hoeller c5590ae9e6 Log column type for limited support message in getResultSetValue
Closes gh-32601
2024-04-09 16:14:45 +02:00
Juergen Hoeller 39b551c334 Document hand-off to execution thread (including ScheduledFuture impact)
Closes gh-32589
2024-04-09 16:14:38 +02:00
Sébastien Deleuze 23696b7db8 Add a classpath check for AOP Coroutines/Reactive conversion
Closes gh-32599
2024-04-09 15:21:21 +02:00
Stéphane Nicoll 7b7cfb27a3 Upgrade to Micrometer 1.12.5
Closes gh-32596
2024-04-09 12:59:46 +02:00
Juergen Hoeller f2889b1b43 Consistent support for generic FactoryBean type matching
Closes gh-32590
See gh-32489
2024-04-08 22:39:29 +02:00
Stéphane Nicoll 802967fc98 Add reproducer
See gh-32489
2024-04-08 11:09:56 +02:00
Juergen Hoeller 22328905da Do not extract FactoryBean generic in case of targetType mismatch
Closes gh-32489
2024-04-08 09:51:59 +02:00
Juergen Hoeller 67a81004a2 Upgrade to AspectJ 1.9.22, Groovy 4.0.20, Tomcat 10.1.20, Netty 4.1.108, OpenPDF 1.3.43, Woodstox 6.6.2, Checkstyle 10.15 2024-04-05 18:04:58 +02:00
Juergen Hoeller 84963ba4d8 Polishing 2024-04-05 18:04:08 +02:00
Juergen Hoeller 07472758ee Detect Undertow RequestTooBigException message in handleParseFailure
Closes gh-32549
2024-04-05 18:03:44 +02:00
Arjen Poutsma 47c9c7eb07 Update copyright
See gh-32528
2024-04-05 16:13:39 +02:00
Stéphane Nicoll 8568aa691c Stop linking to Websphere's Javadoc
Closes gh-32581
2024-04-05 15:57:58 +02:00
Arjen Poutsma b24221754a ReactorNettyClientResponse should close response body
This commit ensures that the response body is drained and closed when
the response itself is closed, instead of disposing the connection, as
this will disable the connection pool.

Closes gh-32528
2024-04-05 15:38:18 +02:00
Sébastien Deleuze 7a666cfd86 Revert some null-safety changes
This commit reverts some null-safety changes which make sense
on main but are too impactful for 6.1.x for Kotlin developers
using -Xjsr305=strict.

See gh-32475
2024-04-05 14:59:39 +02:00