Commit Graph

30981 Commits

Author SHA1 Message Date
rstoyanchev 186deb777f Update deprecation notices on rawStatusCode
Mark for removal where not marked, and set to 7.0
consistently as the target for removal.

See gh-33440
2024-08-28 18:49:49 +03:00
rstoyanchev 57cb8c7abf Restore rawStatusCode methods
Revert methods removed in 7df2e2a8d2.

See gh-33440
2024-08-28 18:12:26 +03:00
Sam Brannen 5bcfcdd0be Polishing 2024-08-28 14:46:12 +02:00
Sam Brannen 38a56b3fda Unwrap CGLIB proxy when invoking non-proxied methods in ReflectionTestUtils
Prior to this commit, when ReflectionTestUtils was used to invoke a
method on a CGLIB proxy, the invocation was always performed directly
on the proxy. Consequently, if the method was not proxied/intercepted
by the CGLIB proxy -- for example, if the method was final or
effectively private -- the invoked method could not operate on the
state of the target object or interact with other private methods in
the target object.

With this commit, if the supplied target object is a CGLIB proxy which
does not intercept the method, the proxy will be unwrapped allowing the
method to be invoked directly on the ultimate target of the proxy.

Closes gh-33429
2024-08-28 14:31:24 +02:00
Sébastien Deleuze 6d1294ddad Merge branch '6.1.x' 2024-08-27 15:39:04 -07:00
Sébastien Deleuze 871539ab28 Fix a typo in the CDS documentation
Closes gh-33437
2024-08-27 15:38:56 -07:00
Sam Brannen ba774c6290 Restore behavior for ClassUtils.getInterfaceMethodIfPossible()
Commit 47f88e123f introduced support for invoking init/destroy/SpEL
methods via public types whenever possible. To achieve that,
getInterfaceMethodIfPossible() was modified so that it only returned
interface methods from public interfaces; however, we have learned that
third parties relied on the previous behavior which found any interface
method (even in non-public interfaces).

In light of the above, this commit partially reverts commit 47f88e123f
in order to reinstate getInterfaceMethodIfPossible() in non-deprecated
form with its previous behavior.

See gh-33216
2024-08-27 11:42:07 +02:00
Sam Brannen d2ea5b4448 Polish internal Javadoc 2024-08-23 11:24:22 +02:00
Sam Brannen 47f88e123f Invoke init/destroy/SpEL methods via public types whenever possible
Prior to this commit, when invoking init methods and destroy methods
for beans as well as methods within Spring Expression Language (SpEL)
expressions via reflection, we invoked them based on the "interface
method" returned from ClassUtils.getInterfaceMethodIfPossible(). That
works well for finding methods defined in an interface, but it does not
find public methods defined in a public superclass.

For example, in a SpEL expression it was previously impossible to
invoke toString() on a non-public type from a different module. This
could be seen when attempting to invoke toString() on an unmodifiable
list created by Collections.unmodifiableList(...). Doing so resulted in
an InaccessibleObjectException.

Although users can address that by adding an appropriate --add-opens
declaration, such as --add-opens java.base/java.util=ALL-UNNAMED, it is
better if applications do not have to add an --add-opens declaration
for such use cases in SpEL. The same applies to init methods and
destroy methods for beans.

This commit therefore introduces a new
getPubliclyAccessibleMethodIfPossible() method in ClassUtils which
serves as a replacement for getInterfaceMethodIfPossible().

This new method finds the first publicly accessible method in the
supplied method's type hierarchy that has a method signature equivalent
to the supplied method. If the supplied method is public and declared
in a public type, the supplied method will be returned. Otherwise, this
method recursively searches the class hierarchy and implemented
interfaces for an equivalent method that is public and declared in a
public type. If a publicly accessible equivalent method cannot be
found, the supplied method will be returned, indicating that no such
equivalent method exists.

All usage of getInterfaceMethodIfPossible() has been replaced with
getPubliclyAccessibleMethodIfPossible() in spring-beans and
spring-expression. In addition, getInterfaceMethodIfPossible() has been
marked as deprecated in favor of the new method.

As a bonus, the introduction of getPubliclyAccessibleMethodIfPossible()
allows us to delete a fair amount of obsolete code within the SpEL
infrastructure.

See gh-29857
Closes gh-33216
2024-08-22 14:35:21 +02:00
Sam Brannen cac623b3f4 Refer to the "Java Module System" instead of "Jigsaw" 2024-08-22 13:00:39 +02:00
Brian Clozel c5f51aab67 Merge branch '6.1.x' 2024-08-22 09:32:11 +02:00
alfredo-toledano aca5db817d Fix link to core container introduction in ref docs
Closes gh-33417
2024-08-22 09:30:47 +02:00
Sébastien Deleuze c71409821d Polishing
Closes gh-33402
2024-08-20 18:32:37 +02:00
dev-chpark a9cbb01a45 Rename test method to clarify its purpose
See gh-33402
2024-08-20 18:32:30 +02:00
Sam Brannen 4a099d213e Add missing @⁠TestMethodOrder declarations 2024-08-19 14:46:21 +02:00
Sam Brannen 9f0417fb33 Merge branch '6.1.x' 2024-08-19 13:58:31 +02:00
Sam Brannen b2c1f978a4 Stop logging result in WebAsyncManager
Closes gh-33406
2024-08-19 13:53:06 +02:00
Brian Clozel 96573ee5e1 Merge branch '6.1.x' 2024-08-19 11:48:36 +02:00
Brian Clozel 50be08480d Open observation scope in RestClient
Prior to this commit, the `RestClient` instrumentation would create and
close observations for HTTP requests, but would not open an observation
scope for the lifetime of the exchange.
This means that custom `ClientHttpRequestInterceptor` and
`ResponseErrorHandler` would not get access to the current observation
scope in case of tracing, possibly leading to missing trace ids in logs.

This commit ensures that an observation scope is managed for the
lifetime of the HTTP exchange.

Fixes gh-33397
2024-08-19 11:48:26 +02:00
Simon Baslé 107ae6159b Add tests for MockitoBean reset of mocks/spies from a FactoryBean
Closes gh-33405
2024-08-19 11:10:19 +02:00
Sébastien Deleuze 94d8fc7af8 Merge branch '6.1.x' 2024-08-19 10:46:54 +02:00
Sébastien Deleuze 0101945708 Prevent a leak in WebTestClient
This commit applies the same kind of processing for
Void.class element type in the ParameterizedTypeReference
variant of WebTestClient.ResponseSpec#returnResult than
in the Class variant.

Closes gh-33389
2024-08-19 10:46:47 +02:00
Sébastien Deleuze eb7a95cfdb Merge branch '6.1.x' 2024-08-19 09:47:08 +02:00
Sébastien Deleuze d41ca095ab Add native support for Kotlin default values in controllers
Closes gh-33384
2024-08-19 09:46:53 +02:00
Sam Brannen 346b6f740a Polish contribution
See gh-33401
2024-08-18 14:58:05 +02:00
tafjwr 4ffeddb099 Add tests for ControllerAdviceBean#resolveBean() and revise existing tests
Closes gh-33401
2024-08-18 14:52:05 +02:00
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
Sam Brannen 04271c3ead Merge branch '6.1.x' 2024-08-18 13:04:21 +02:00
Sam Brannen 143736e59b Enforce order of Javadoc tags for records
Closes gh-33403
2024-08-18 13:01:43 +02:00
Sam Brannen e50383e921 Improve Javadoc for SpEL's Expression API 2024-08-17 15:59:00 +02:00
Sébastien Deleuze f854800043 Merge branch '6.1.x' 2024-08-16 17:05:23 +02:00
Sébastien Deleuze e0cb7aa0a0 Build documentation branches only for 6.1 and later
To avoid a duplication error caused by a conflict between the
6.0.x branch and the v6.0.23 tag.

Closes gh-33398
2024-08-16 17:04:55 +02:00
Sam Brannen de33056c83 Use new features from JUnit Jupiter 5.11
This commit migrates additional parameterized tests (that were missed in
the previous commit) to the new argumentSet() feature.

See gh-33395
2024-08-16 15:48:47 +02:00
Sébastien Deleuze a9a1798012 Merge branch '6.1.x' 2024-08-16 14:37:56 +02:00
Sébastien Deleuze 46c29b9175 Support Boolean property in BindingReflectionHintsRegistrar
Closes gh-33380
2024-08-16 14:37:12 +02:00
Sam Brannen d749d2949d Use new features from JUnit Jupiter 5.11
This commit primarily migrates to the new argumentSet() feature but also
applies additional polishing to our use of parameterized tests.

See gh-33395
2024-08-16 13:48:19 +02:00
Sam Brannen 2eff5cb463 Upgrade to JUnit 5.11
Closes gh-33395
2024-08-15 18:15:15 +02:00
Stéphane Nicoll 6cc0561625 Merge branch '6.1.x' 2024-08-14 13:27:57 +02:00
Stéphane Nicoll 1634e63506 Next development version (v6.1.13-SNAPSHOT) 2024-08-14 13:27:42 +02:00
rstoyanchev 974dec262c Merge branch '6.1.x' 2024-08-14 07:33:15 +03:00
rstoyanchev bb17ad8314 Efficient ETag parsing 2024-08-14 07:19:59 +03:00
Juergen Hoeller e1cf203295 Merge branch '6.1.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2024-08-13 19:05:20 +02:00
Juergen Hoeller 63486bf19c Upgrade to Tomcat 10.1.28, Jetty 12.0.12, Netty 4.1.112, Undertow 2.3.15 2024-08-13 18:52:15 +02:00
Juergen Hoeller d0bff584d7 Polishing 2024-08-13 18:51:02 +02:00
Juergen Hoeller 8be5010f5d LocaleEditor supports BCP 47 language tags as well
Closes gh-33348
2024-08-13 18:50:30 +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
Stéphane Nicoll 599fc8796b Upgrade to Reactor 2024.0.0-M5
Closes gh-33328
2024-08-13 18:07:31 +02:00
Stéphane Nicoll 57171143b9 Upgrade to Micrometer 1.14.0-M2
Closes gh-33327
2024-08-13 18:07:08 +02:00
Stéphane Nicoll 50c927b649 Merge branch '6.1.x' 2024-08-13 17:30:16 +02:00
Stéphane Nicoll 86761cd233 Upgrade to Reactor 2023.0.9
Closes gh-33326
2024-08-13 17:27:02 +02:00