Commit Graph

24340 Commits

Author SHA1 Message Date
Juergen Hoeller
083113d8a4 Use SQLExceptionSubclassTranslator by default (avoiding sql-error-codes.xml)
SQLErrorCodeSQLExceptionTranslator kicks in for user-provided sql-error-codes.xml files. It will still pick up Spring's legacy default error code mappings as well but only when triggered by a (potentially empty) user-provided file in the root of the classpath.

Closes gh-28216
2022-06-14 14:00:56 +02:00
Juergen Hoeller
4e1b9f1492 Replace deep exception message nesting with custom inclusion of cause messages
Includes deprecation of NestedServletException, whereas NestedCheckedException and NestedRuntimeException remain as base classes with several convenience methods.

Closes gh-25162
2022-06-14 14:00:28 +02:00
rstoyanchev
933965b7b4 Merge branch '5.3.x' 2022-06-14 12:20:34 +01:00
Arjen Poutsma
bf9f261b95 Revert "Support recursive annotations in merged annotations"
This reverts commit 3ec612aaf8.
2022-06-14 13:03:29 +02:00
Arjen Poutsma
df37e33105 Revert "Ensure fix for gh-28012 is actually tested"
This reverts commit 3188c0f7db.
2022-06-14 13:03:05 +02:00
rstoyanchev
8c777111fa Revise commit #52d068 with corrected test
Update test detecting RouterFunction beans in parent contexts to use
different bean names and avoid shadowing. Changed the fix accordingly
given that BeanProvider does detect beans in parent contexts.

See gh-28595
2022-06-14 10:07:56 +01:00
Arjen Poutsma
1881e48bb4 Remove Jetty dependencies from JdkHttpClientResourceFactory
This commit removes the Eclipse Jetty dependencies from
JdkHttpClientResourceFactory, replacing them with a check for
ExecutorService.

Closes gh-28588
2022-06-14 10:59:02 +02:00
rstoyanchev
d28d603081 Polishing
See gh-28595
2022-06-14 09:35:17 +01:00
rstoyanchev
52d0681ca1 WebMvc respects RouterFunction beans ordering
Closes gh-28595
2022-06-14 09:20:19 +01:00
Brian Clozel
7e8b1ed401 Polish
Move hints registration to spring-beans, where the actual behavior is
implemented. We chose not to move this to
`AutowiredAnnotationBeanPostProcessor` for now, as this would require it
to implement another AOT-related interface and add too much noise for
this.

See gh-28614
2022-06-14 10:08:06 +02:00
Brian Clozel
bb952cb95e Register native hints for jakarta.inject annotations
Prior to this commit, native images would dynamically check for the
presence of `jakarta.inject.*` annotations and might fail at runtime or
miss them entirely.

This change ensures that if such classes are present during the AOT
build, relevant runtime hints are registered so that these annotations
can be read at runtime.

Closes gh-28614
2022-06-13 18:50:33 +02:00
Brian Clozel
15b69a3ede Polish RuntimeHintsPredicates
This commit adds a method variant checking that all `MemberCategory` are
supported by the `RuntimeHints` for a given type hint.

See gh-28555
2022-06-13 18:40:46 +02:00
Sam Brannen
dc3ec5b665 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java
2022-06-13 18:06:08 +02:00
Sam Brannen
97854d9fec Refactor ObjectToObjectConverter to use Executable instead of Member 2022-06-13 18:01:54 +02:00
Sam Brannen
73f3860bb7 Polish Javadoc for ObjectToObjectConverter 2022-06-13 18:01:05 +02:00
Sam Brannen
f722dbe5a8 Polishing 2022-06-13 17:35:50 +02:00
Sam Brannen
c3b29960ed Merge branch '5.3.x' 2022-06-13 17:23:14 +02:00
Sam Brannen
452f1b877c Consider return type of static methods in ObjectToObjectConverter
Prior to this commit, ObjectToObjectConverter considered the return
type of non-static `to[targetType.simpleName]()` methods but did not
consider the return type of static `valueOf(sourceType)`,
`of(sourceType)`, and `from(sourceType)` methods.

This led to scenarios in which `canConvert()` returned `true`, but a
subsequent `convert()` invocation resulted in a
ConverterNotFoundException, which violates the contract of the
converter.

This commit addresses this issue by taking into account the return type
of a static valueOf/of/from factory method when determining if the
ObjectToObjectConverter supports a particular conversion. Whereas the
existing check in `determineToMethod()` ensures that the method return
type is assignable to the `targetType`, the new check in
`determineFactoryMethod()` leniently ensures that the method return
type and `targetType` are "related" (i.e., reside in the same type
hierarchy).

Closes gh-28609
2022-06-13 17:20:18 +02:00
Sébastien Deleuze
a57dead4be Add support for serialization in RequestMappingReflectiveProcessor
Support reflection-based serialization of parameters annotated
with @RequestBody and return values annotated with @ResponseBody.

It leverages a new BindingReflectionHintsRegistrar class that
is designed to register transitively the types usually needed
for binding and reflection-based serialization on fields,
constructors and properties. Generics are taken in account
as well.

Closes gh-28518
2022-06-13 15:25:44 +02:00
Sébastien Deleuze
12d756a252 Refine ReflectiveProcessorBeanRegistrationAotProcessor
Add support for processing implemented interfaces and
remove Reflective from runtime hints.

See gh-28518
2022-06-13 14:54:57 +02:00
Sébastien Deleuze
2b76a12b86 Refine build time init configuration
For Spring MVC and RestTemplate.

See gh-28518
2022-06-13 14:54:57 +02:00
Stephane Nicoll
0992f855e6 Add base infra for Web controllers hints
See gh-28518
2022-06-13 14:52:45 +02:00
Arjen Poutsma
472af9c25f Merge branch '5.3.x' 2022-06-13 14:02:02 +02:00
Arjen Poutsma
c278d8c656 Do not ignore charset in Jaxb2XmlDecoder
This commit makes sure that the charset, if defined in the mimetype, is
used when decoding XML to JAXB2 objects.

Closes gh-28599
2022-06-13 13:47:31 +02:00
Stephane Nicoll
b19db4d118 Merge branch '5.3.x' 2022-06-13 11:39:36 +02:00
Stephane Nicoll
e3b288716d Upgrade to Reactor 2020.0.20
Closes gh-28612
2022-06-13 11:39:15 +02:00
Brian Clozel
9c9b2356ce Add RuntimeHints predicates generator
The `RuntimeHints` API allows to describe hints for the reflection,
proxies and resources behavior at runtime. The need for a particular
behavior can be covered by several types of hints, at different levels.
This knowledge can be important in several cases:

* before contributing additional hints, infrastructure can check if an
  existing hint already covers the behavior
* this can be used in test suites and test infrastructure

This commit adds a new RuntimeHintsPredicates that generates `Predicate`
instances for testing `RuntimeHints` against a desired runtime behavior
for reflection, resources or proxies.

Closes gh-28555
2022-06-10 18:55:14 +02:00
Stephane Nicoll
100ce9642a Use TypeReference consistently in hints writer
Closes gh-28606
2022-06-10 15:28:24 +02:00
Arjen Poutsma
405e5921a6 Merge branch '5.3.x' 2022-06-10 13:38:27 +02:00
Arjen Poutsma
27738cc20f Fix code samples for nested router functions
Closes gh-28603
2022-06-10 13:36:33 +02:00
Stephane Nicoll
1e5f4f8b44 Polish 2022-06-09 15:12:38 +02:00
Stephane Nicoll
363722893b Make sure RuntimeHintsRegistrar are invoked only once
Close gh-28594
2022-06-09 15:02:32 +02:00
Sam Brannen
74d1be9bd8 Remove obsolete references to @Required
Since the @Required annotation was removed in a previous 6.0 milestone,
this commit removes all remaining references to it.

Closes gh-28600
2022-06-09 14:54:09 +02:00
Sébastien Deleuze
b9f85627a1 Improve ResourcePatternHint documentation
Closes gh-28598
2022-06-09 14:50:43 +02:00
Sébastien Deleuze
99ffd97a72 Fix ResourceHintsWriter for leading/trailing wildcards
Closes gh-28597
2022-06-09 14:50:43 +02:00
Sam Brannen
40ab20e14a Merge branch '5.3.x' 2022-06-09 13:56:15 +02:00
Sam Brannen
babff8e635 Fix Kotlin example for dependency injection with static factory method
Closes gh-28589
2022-06-09 13:16:19 +02:00
Sam Brannen
290cc73d3d Fix Kotlin example for @Required
Since @Required can only be declared on a method, this commit moves the
@Required declaration from the field to the "set" method.

Closes gh-28590
2022-06-09 13:13:43 +02:00
Stephane Nicoll
48e8bf1cba Merge branch '5.3.x' 2022-06-09 08:17:47 +02:00
Stephane Nicoll
8a30bc2993 Upgrade Java 18 version in CI image 2022-06-09 08:14:54 +02:00
Stephane Nicoll
aa8be28a01 Upgrade Java 17 version in CI image 2022-06-09 08:14:30 +02:00
Stephane Nicoll
f43b28e7ba Upgrade Java 11 version in CI image 2022-06-09 08:14:05 +02:00
Stephane Nicoll
1476867ee7 Upgrade Java 18 version in CI image 2022-06-09 08:13:36 +02:00
Stephane Nicoll
4d9dc61f5d Polish 2022-06-09 08:13:12 +02:00
Stephane Nicoll
7eebc48a6e Upgrade Ubuntu version in CI image 2022-06-09 08:11:36 +02:00
Arjen Poutsma
283bc9ede9 Merge pull request #28569 from christophejan:fix/28567
* gh-28567:
  Polish
  Add minimal Kotlin DSL RouterFunction attributes support
  Add test case on nested RouterFunction attributes
2022-06-08 17:08:44 +02:00
Arjen Poutsma
216a266856 Polish 2022-06-08 17:00:58 +02:00
christophejan
bbabf8d855 Add minimal Kotlin DSL RouterFunction attributes support
Closes gh-28567
2022-06-08 16:49:46 +02:00
christophejan
5b1bda5c7c Add test case on nested RouterFunction attributes 2022-06-08 16:49:46 +02:00
Sam Brannen
282c3bc952 Merge branch '5.3.x' 2022-06-08 16:40:23 +02:00