Commit Graph

25473 Commits

Author SHA1 Message Date
Johnny Lim
eeebea1da3 Replace StringBuffer with StringBuilder in CGLIB fork 2022-10-14 18:45:08 +02:00
Juergen Hoeller
b796b52d4e Extract SimpleBeanInfo adaptation into internal SimpleBeanInfoFactory
See gh-29320
2022-10-14 12:34:43 +02:00
Juergen Hoeller
bba313c2f5 Perform basic property determination without java.beans.Introspector
Closes gh-29320
2022-10-13 19:02:45 +02:00
rstoyanchev
113db2fb2f Fix regression in AbstractJackson2Decoder
Closes gh-29307
2022-10-13 15:45:25 +01:00
Yanming Zhou
19cbba6b34 Use correct RFC number for ProblemDetail support in Javadoc
Closes gh-29302
2022-10-13 16:16:41 +02:00
Stephane Nicoll
ba0a835880 Merge branch '5.3.x' 2022-10-13 11:29:49 +02:00
Stephane Nicoll
3f42d4de43 Upgrade Ubuntu version in CI image 2022-10-13 11:29:31 +02:00
Arjen Poutsma
ce03980fb4 Mark HttpRequest::getMethodValue and ClientHttpResponse::getRawStatusCode for removal 2022-10-12 16:29:14 +02:00
Arjen Poutsma
2c58eea781 Mark HttpMethod::resolve for removal 2022-10-12 15:32:51 +02:00
Stephane Nicoll
fadf69fb68 Merge pull request #29308 from izeye
* pr/29308:
  Upgrade to Dokka 1.7.20

Closes gh-29308
2022-10-12 14:45:29 +02:00
Johnny Lim
8d3a1b4c9c Upgrade to Dokka 1.7.20
See gh-29308
2022-10-12 14:39:05 +02:00
Juergen Hoeller
02979efb2c Upgrade to Netty 4.1.84 2022-10-12 09:38:51 +02:00
Juergen Hoeller
7025c3bbd4 Upgrade to ASM 9.4
Closes gh-29305
2022-10-12 08:32:42 +02:00
Sam Brannen
313b53a62a Merge branch '5.3.x' 2022-10-11 20:50:33 +02:00
Sam Brannen
5ac687f4aa Add warning to AnnotatedElementUtils.getMergedRepeatableAnnotations()
See gh-20279
2022-10-11 20:49:19 +02:00
Sam Brannen
0ed3a46a2a Merge branch '5.3.x' 2022-10-11 19:39:20 +02:00
Sam Brannen
332b25b680 Support searches for non-public repeatable annotations
Prior to this commit, searches for non-public repeatable annotations
failed with error messages similar to the following, since the
repeatable annotation's container's `value()` method could not be
invoked via reflection.

JDK 8:

java.lang.IllegalAccessError: tried to access class
org.springframework.core.annotation.NestedRepeatableAnnotationsTests$A
from class com.sun.proxy.$Proxy12

JDK 17:

java.lang.IllegalAccessError: failed to access class
org.springframework.core.annotation.NestedRepeatableAnnotationsTests$A
from class jdk.proxy2.$Proxy12
(org.springframework.core.annotation.NestedRepeatableAnnotationsTests$A
is in unnamed module of loader 'app'; jdk.proxy2.$Proxy12 is in module
jdk.proxy2 of loader 'app')

This commit makes it possible to search for non-public repeatable
annotations by first attempting to invoke the repeatable annotation's
container's `value()` method via the container's InvocationHandler (if
the container is a JDK dynamic proxy) and then falling back to
reflection for the method invocation if an error occurs (such as a
SecurityException).

Closes gh-29301
2022-10-11 19:27:40 +02:00
Sam Brannen
48a9fd815f Merge branch '5.3.x' 2022-10-11 18:11:29 +02:00
Sam Brannen
9876701493 Support nesting in AnnotatedElementUtils.getMergedRepeatableAnnotations()
This commit is a follow up to 828f74f71a
and applies to same fix for getMergedRepeatableAnnotations().

See the previous commit for details.

Closes gh-20279
2022-10-11 18:06:00 +02:00
rstoyanchev
141e735b18 Upgrade to Reactor 2022.0.0-RC1
Closes gh-29268
2022-10-11 16:55:13 +01:00
Sam Brannen
65ab67ef2b Merge branch '5.3.x' 2022-10-11 17:36:08 +02:00
Sam Brannen
828f74f71a Support nesting in AnnotatedElementUtils.findMergedRepeatableAnnotations()
Prior to this commit, the findMergedRepeatableAnnotations() methods in
AnnotatedElementUtils failed to find repeatable annotations declared
on other repeatable annotations (i.e., when one repeatable annotation
type was used as a meta-annotation on a different repeatable annotation
type).

The reason is that
findMergedRepeatableAnnotations(element, annotationType, containerType)
always used RepeatableContainers.of(annotationType, containerType) to
create a RepeatableContainers instance, even if the supplied
containerType was null. Doing so restricts the search to supporting
only repeatable annotations whose container is the supplied
containerType and prevents the search from finding repeatable
annotations declared as meta-annotations on other types of repeatable
annotations.

Note, however, that direct use of the MergedAnnotations API already
supported finding nested repeatable annotations when using
RepeatableContainers.standardRepeatables() or
RepeatableContainers.of(...).and(...).and(...). The latter composes
support for multiple repeatable annotation types and their containers.

This commit addresses the issue for findMergedRepeatableAnnotations()
when the containerType is null or not provided.

However, findMergedRepeatableAnnotations(element, annotationType, containerType)
still suffers from the aforementioned limitation, and the Javadoc has
been updated to make that clear.

Closes gh-20279
2022-10-11 17:21:28 +02:00
rstoyanchev
6c3a7192b7 Add classpath check for context-propagation
See gh-29056
2022-10-11 15:53:46 +01:00
Sam Brannen
965dd66f8c Improve Javadoc for RepeatableContainers 2022-10-11 16:41:19 +02:00
Arjen Poutsma
dedcb19f44 Document PartEvent API
Closes #29170
2022-10-11 16:28:41 +02:00
rstoyanchev
cf2b1020f4 Update table of supported controller method return types
Closes gh-28814
2022-10-11 15:10:30 +01:00
rstoyanchev
04f0f1ddb0 Update table of supported controller method return types
See gh-27052
2022-10-11 14:38:38 +01:00
Juergen Hoeller
bba66429fb Polishing 2022-10-11 15:35:25 +02:00
Juergen Hoeller
0f8ca805e1 Move hints to dedicated top-level package (avoiding aot<->support cycle)
See gh-29026, gh-29069
2022-10-11 15:34:30 +02:00
Juergen Hoeller
4bb2e23239 Resolve CGLIB core<->transform package cycle
See gh-28955
2022-10-11 15:34:07 +02:00
Stephane Nicoll
45939720f2 Add native support for @ExceptionHandler
This commit makes sure that `@ExceptionHandler`-annotated methods can be
invoked via reflection in a native image. As most of the handling of
the parameter and the return type is shared with our generic
RequestMapping handling, the ReflectiveProcessor extends from it.

An `@ExceptionHandler`-annotated method can return a `ProblemDetail`. If
that's the case, reflection entries are contributed.

Closes gh-29297
2022-10-11 10:18:23 +02:00
Juergen Hoeller
c94b676576 Specifically handle "java."/"javax." packages in SpringNamingPolicy
Closes gh-27622
2022-10-10 21:50:26 +02:00
Brian Clozel
fbb8cdb948 Upgrade to Context Propagation 1.0.0-RC1
Closs gh-29273
2022-10-10 21:34:09 +02:00
Brian Clozel
ac8c36a5c8 Upgrade to Micrometer 1.10.0-RC1
Closes gh-29241
2022-10-10 21:32:53 +02:00
Johnny Lim
d4a08dae43 Fix typos in CorsConfiguration[Tests]
Closes gh-29292
2022-10-10 19:27:41 +02:00
Sam Brannen
f00e4b230f Support method chaining in AbstractAotProcessor.Settings
See gh-29266
2022-10-10 19:09:41 +02:00
Sam Brannen
7ed42ca4ca Polish ContextAotProcessor 2022-10-10 18:58:27 +02:00
Sam Brannen
cad7444afa Introduce Settings container in AbstractAotProcessor
See gh-29266
2022-10-10 18:58:27 +02:00
Sébastien Deleuze
7b4ff5ea74 Make BindingReflectionHintsRegistrar protected methods private
In order to keep the maximum of flexibility, this commit makes
shouldSkipType and shouldSkipMembers methods private.

That will allow for example to refactor
BindingReflectionHintsRegistrar in order to support skipping
custom classes specified via @RegisterReflectionForBinding
without having to subclass it.

See gh-29279
2022-10-10 18:18:36 +02:00
Stephane Nicoll
4eca87baa3 Handle hints for CGLIB proxies consistently
This commit makes sure that hints are registered for CGLIB proxies even
if the proxy itself is not created. This typically happens when AOT runs
on an existing classpath, and a previous run already created the proxy.

Closes gh-29295
2022-10-10 17:39:26 +02:00
Stephane Nicoll
e8ce86a6f0 Relocate testfixtures 2022-10-10 17:36:11 +02:00
Juergen Hoeller
a1daaf0c19 Revise CGLIB naming policy to only contain SpringCGLIB label once
See gh-29295
2022-10-10 17:34:31 +02:00
Sam Brannen
de609e5d45 Polishing 2022-10-10 16:52:22 +02:00
Juergen Hoeller
26c6a742d9 Introduce setLoadedClassHandler method on CGLIB ReflectUtils
See gh-29295
2022-10-10 16:49:55 +02:00
Sam Brannen
b2b3163fae Redesign AOT processors for consistency and simplification
There's currently a considerable amount of overlap between the
implementations of AotProcessor and TestAotProcessor. In addition
AotProcessor is abstract and does not include a main() method; whereas,
TestAotProcessor is concrete and does include a main() method.

To address these issues, this commit:

- Introduces an AbstractAotProcessor base class that AotProcessor and
  TestAotProcessor now both extend

- Moves common properties/functionality to AbstractAotProcessor

- Renames AotProcessor to ContextAotProcessor

- Makes TestAotProcessor abstract like ContextAotProcessor

- Removes the main() method from TestAotProcessor

Closes gh-29266
2022-10-10 16:27:04 +02:00
Stephane Nicoll
061fa475ee Avoid generated code in the javax package
This commit updates the existing logic to also exclude code generation
in the javax package.

Closes gh-29123
2022-10-10 15:09:00 +02:00
Stephane Nicoll
76e87ad475 Polish 2022-10-10 15:09:00 +02:00
Sam Brannen
34e5aac0f5 Reintroduce factory method name in exception thrown from SimpleInstantiationStrategy 2022-10-10 14:28:35 +02:00
Arjen Poutsma
8227032a0f Improve exception message if MultipartParser can not find end of body
This commit improves the exception message thrown by MultipartParser
when it cannot find the end of the multipart body, by showing in the
message what the parser is looking for (CRLF--<boundary>).

Closes gh-28067
2022-10-10 13:26:46 +02:00
Sébastien Deleuze
8ed1906f43 Refine SQLErrorCodesFactory reachability on native images
SQLErrorCodeSQLExceptionTranslator#USER_PROVIDED_ERROR_CODES_FILE_PRESENT
evaluation at build time combined with the lazy
SQLErrorCodesFactory#instance initialization allow to
avoid making SQLErrorCodesFactory constructor reachable
when no custom sql-error-codes.xml is provided.

Closes gh-29294
2022-10-10 12:11:19 +02:00