Commit Graph

24067 Commits

Author SHA1 Message Date
Phillip Webb 99173fbd4f Add GeneratedFiles interface and support classes
Add a `GeneratedFiles` interface that can be used to add generated
source, class and resource files. An in-memory implementation is
provided for testing and a filesystem implementation is provided
to actually save the files to disk.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb f2cf78c525 Add programmatic autowiring support classes
Add resolver utilities that can be used to perform programmatic
autowiring of fields, methods, constructors and factory methods.

The resolvers are designed to work in an AOT environment and
allows the actual injection to be performed using functional
interfaces. This allows leaner images to be created since
`introspection` hints are required rather than full `invocation`
hints.

The resolvers also provide a reflection based fallback that can
used when the functional interface cannot work. For example, a
reflection based solution is required for private fields, methods
and constructors.

See gh-28414
2022-05-05 12:35:21 -07:00
Phillip Webb 3209d7f126 Add InstanceSupplier and RegisteredBean support
Add a new `InstanceSupplier` interface that can be used as an
alternative to a regular bean `Supplier` when details about the
bean being supplied are required to instantiate it. The new
interface accepts a `RegisteredBean` instance which provides
access to the bean name, the bean factory creating the bean
and the bean definition.

This interface is primarily designed to allow AOT generated code
to autowire dependencies into the instance.

See gh-28414
2022-05-05 12:35:21 -07:00
Phillip Webb d31eb4c0f1 Add RootBeanDefinition constructor that accepts a ResolvableType
Add a new convenience constructor to `RootBeanDefinition` that allow
it to be created with a `ResolvableType`.

Closes gh-28418
2022-05-05 12:35:21 -07:00
Phillip Webb 4b82546b97 Improve TestCompiler and allow lookup based class defines
Update the `TestCompiler` so that classes can be defined using
a `Lookup`. This update allows package-private classes to be
accessed without needing a quite so unusual classloader setup.

The `@CompileWithTargetClassAccess` should be added to any
test that needs to use `Lookup` based defines. The test will
run with a completed forked classloader so not to pollute the
main classloader.

This commit also adds some useful additional APIs.

See gh-28120
2022-05-05 12:35:21 -07:00
Phillip Webb b3efdf3c2b Add Throwable functional interfaces
Add 'Throwable' variants of the `Consumer`, `Function`, `BiFunction` and
`Supplier` interfaces that wrap checked exceptions or allow calls to be
made that throw them.

Closes gh-28417
2022-05-05 12:35:21 -07:00
Phillip Webb d30e6bf647 Add MockSpringFactoriesLoader
Add a `MockSpringFactoriesLoader` class which allows for easier
testing of code that works with a `SpringFactoriesLoader`.

Closes gh-28416
2022-05-05 12:35:21 -07:00
Phillip Webb 58c441f961 Support multiple SpringFactoriesLoader files
Update `SpringFactoriesLoader` so that it can load files from
arbitrary locations. An instance of the loader class itself is now
returned from static factory methods that accept different
locations.

The recent `ArgumentResolver` and `FailureHandler` `loadFactories`
variants are now no longer available as static methods. They are
still available as instance methods.

The `loadFactories` static method remains to provide
back-compatibility with Spring Framework 5.x

See gh-28416
2022-05-05 12:35:21 -07:00
Phillip Webb f17372ebea Add position variant of ObjectUtils.addObjectToArray
Add an overloaded version of `ObjectUtils.addObjectToArray` that allows
inserts at a specific position.

Closes gh-28415
2022-05-05 12:35:21 -07:00
Phillip Webb 44bdcef0b9 Tweak Eclipse settings 2022-05-05 12:35:21 -07:00
Phillip Webb ddba45d01d Polish formatting 2022-05-05 12:35:21 -07:00
Juergen Hoeller 8c2b1e633e Upgrade to Hibernate ORM 5.6.8, POI 5.2.2, Caffeine 3.1 2022-05-05 18:15:32 +02:00
Juergen Hoeller bf4e3975fb Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-05-05 18:07:39 +02:00
Juergen Hoeller f771603789 Polishing 2022-05-05 18:04:54 +02:00
Juergen Hoeller e441832e99 Accept WritableResource as required dependency type as well
Closes gh-15284
2022-05-05 18:04:13 +02:00
Juergen Hoeller f963fc5f98 Check that nullable annotations are from org.springframework.lang
Closes gh-28410
2022-05-05 18:02:27 +02:00
Juergen Hoeller b55eee1b0d Upgrade to ASM 9.3
Closes gh-28390
2022-05-05 18:01:53 +02:00
Juergen Hoeller 28742171fd Upgrade to Netty 4.1.76, Mockito 4.5.1, HtmlUnit 2.61 2022-05-05 18:01:31 +02:00
Juergen Hoeller 122ca4dd98 Assert with isEqualToNormalizingNewlines for Windows compatibility 2022-05-05 17:26:33 +02:00
Juergen Hoeller 17c778e3a0 Preserve javax nullability annotations for AOP Alliance fork
See gh-28410
2022-05-05 17:26:17 +02:00
Juergen Hoeller 0f6d459de7 Support for jakarta.enterprise.concurrent.Asynchronous annotation
Closes gh-28400
2022-05-05 17:25:39 +02:00
Sam Brannen bd4ce3ec16 Upgrade to Gradle 7.4.2 2022-05-05 16:35:52 +02:00
Sam Brannen 0d561caf6d Merge branch '5.3.x' 2022-05-05 16:32:27 +02:00
Lee, Kyutae 7a75b94556 Fix typo in reference docs regarding RequestMappingHandlerAdapter
Closes gh-28370
2022-05-05 16:31:40 +02:00
Sam Brannen 62fcf5e60d Merge branch '5.3.x' 2022-05-05 16:23:19 +02:00
Sam Brannen ab71ff93bb Polish package-info for org.springframework.util
See gh-28411
2022-05-05 16:22:52 +02:00
neals cf30327740 Remove Log4J configurer from package-info.java in spring-core
Closes gh-28411
2022-05-05 16:16:49 +02:00
Sam Brannen 5641584a89 Merge branch '5.3.x' 2022-05-05 16:11:36 +02:00
neals e22a038725 Remove Log4J initialization from package-info.java
Closes gh-28420
2022-05-05 16:10:59 +02:00
Phillip Webb 63b129a3f7 Check that nullable annotations are from org.springframework.lang
Fix a few incorrect nullable annotation imports and add a checkstyle
rule to ensure they don't return.

Closes gh-28410
2022-05-03 11:14:53 -07:00
Brian Clozel 68bb4023eb Merge branch '5.3.x' 2022-05-03 16:12:42 +02:00
Brian Clozel 7aedb9ee33 Build CI image using oci-build-task resource 2022-05-03 15:50:29 +02:00
Sam Brannen 365a18c9c2 Polishing 2022-05-03 15:46:07 +02:00
Brian Clozel c68665980f Merge branch '5.3.x' 2022-05-03 15:11:23 +02:00
Brian Clozel 5b1719cd77 Upgrade CI to concourse-release-scripts 0.3.4 2022-05-03 15:09:23 +02:00
Brian Clozel c056b81753 Upgrade JDK and Ubuntu versions in CI image 2022-05-03 15:08:14 +02:00
Brian Clozel dbdd67ec62 Remove outdated docker-image resource from CI
The docker-image resource is now replaced by the registry-image
resource.
2022-05-03 15:05:58 +02:00
Sam Brannen f692a15460 Merge branch '5.3.x' 2022-05-03 14:34:21 +02:00
Sam Brannen 4fcfa5b991 Update and simplify ArrayConstructorTests 2022-05-03 14:27:48 +02:00
rstoyanchev 2d2726b8f7 Add RequestBody resolver and minor improvements
Support for RequestBody arguments.
List supported arguments on HttpExchange.
Improve null handling.

See gh-28386
2022-05-03 12:42:37 +01:00
rstoyanchev 7797453f28 Refactor resolver tests
Extract NamedValueArgumentResolverTests.
Move form data vs query params tests into HttpRequestValues.

See gh-28386
2022-05-03 12:42:37 +01:00
rstoyanchev 2794553d2e Add resolvers for URI, cookies, and request params
See gh-28386
2022-05-03 12:42:37 +01:00
rstoyanchev f8ac5985bd Extract base class AbstractNamedValueArgumentResolver
Closes gh-28395
2022-05-03 12:42:37 +01:00
rstoyanchev d91b840d0e Polishing and refactoring
See gh-28395
2022-05-03 12:42:37 +01:00
Olga Maciaszek-Sharma 38bf0776a1 Add initial RequestHeaderArgumentResolver implementation and tests. 2022-05-03 12:42:37 +01:00
Sam Brannen 0a9271e721 Suppress warning in test 2022-05-03 12:30:46 +02:00
Sam Brannen 437b35b336 Merge branch '5.3.x' 2022-05-03 12:15:45 +02:00
Sam Brannen ed06a6de26 Convert SimpleFormController example to @Controller in reference manual
This change is necessary since the SimpleFormController class no longer
exists.
2022-05-03 12:03:04 +02:00
Sam Brannen afa799b4f0 Suppress warning in test 2022-05-03 11:46:47 +02:00
Sam Brannen f934c09211 Polish ExtendedBeanInfo 2022-05-02 17:05:25 +02:00