Commit Graph

24828 Commits

Author SHA1 Message Date
Phillip Webb 7664a54c93 Update InitDestroyAnnotationBeanPostProcessor AOT support
Update `InitDestroyAnnotationBeanPostProcessor` so that it provides
AOT contributions via the `BeanRegistrationAotProcessor` interface.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb 77c5a6f18d Update AutowiredAnnotationBeanPostProcessor AOT support
Update `AutowiredAnnotationBeanPostProcessor` so that it provides
AOT contributions via the `BeanRegistrationAotProcessor` interface.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb 4d87071f3a Add AOT interfaces and classes to support bean factories
Add AOT processor and contribution interfaces and classes to
support the generation of code that can re-hydrate a bean
factory.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb c5c68a4662 Add MethodReference support
Add a `MethodReference` class which can be used to refer to a
static or instance method.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb 1816c77c51 Add generation context interface
Add `GenerationContext` interface and `DefaultGenerationContext`
implementation as the central entry point for AOT processing.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb d5374550e5 Add support for generating classes
Add `ClassGenerator` and `GeneratedClass` which can be used to
generated classes that will ultimately be written to a `JavaFile`.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb 55d7f7a014 Add support for generating methods
Add `GeneratedMethods` and `GeneratedMethod` support classes which
can be used during code generation to generation additional methods
that will ultimately be included in a `JavaFile`.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb 16456342f5 Add support for generating method names
Add `MethodNameGenerator` to support generation of method names.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb ca2b5e068b Add support for generating class names
Add `ClassNameGenerator` to support generation of class names.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb a605d3f6ed Add AccessVisibility detection support
Add `AccessVisibility` enum which can be used to determine the
access visibility of `Member` or `ResolvableType`.

See gh-28414
2022-05-05 13:25:36 -07:00
Phillip Webb 9c12833e16 Add withFiles support to TestCompiler
Update `TestCompiler` so that `withFiles` can be used to quickly
configure the compiler with `InMemoryGeneratedFiles`.

See gh-28414
2022-05-05 13:25:36 -07:00
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