Commit Graph

24275 Commits

Author SHA1 Message Date
Phillip Webb
c01a2e897d Fix null assignment to non-nullable field
Update `BeanRegistrationCodeFragments` package-private constructor
to set `codeFragments` to `this` rather than `null`. The field
is never actually read by `DefaultBeanRegistrationCodeFragments` since
all methods are overridden.

Closes gh-28578
2022-06-07 10:09:08 -07:00
Sam Brannen
22ef3ec783 Merge branch '5.3.x'
# Conflicts:
#	.mailmap
2022-06-07 14:30:45 +02:00
Sam Brannen
be1b7da12f Add entries for "Sam Brannen" to .mailmap 2022-06-07 14:27:42 +02:00
Phillip Webb
89360b18f4 Update '.mailmap` to consistently use @vmware.com emails
(cherry picked from commit 83063a7269)
2022-06-07 14:14:10 +02:00
Stephane Nicoll
92961d75f0 Polish tests 2022-06-07 12:03:50 +02:00
Stephane Nicoll
ad0573a91e Polish 2022-06-07 11:52:40 +02:00
Stephane Nicoll
62d98685ce Merge branch '5.3.x' 2022-06-07 08:30:59 +02:00
Stephane Nicoll
209fe5f452 Merge pull request #28572 from gorisanson
* pr/28572:
  Polish contribution
  Update reference docs to use PropertySourcesPlaceholderConfigurer

Closes gh-28572
2022-06-07 08:30:52 +02:00
Stephane Nicoll
e18a118f8b Polish contribution
See gh-28572
2022-06-07 08:29:28 +02:00
Lee, Kyutae
77aac7768d Update reference docs to use PropertySourcesPlaceholderConfigurer
See gh-28572
2022-06-07 08:22:53 +02:00
Phillip Webb
26944f3c8e Implement CompileWithTargetClassAccessClassLoader.findResource
Fixes gh-28574
2022-06-06 12:28:33 -07:00
Phillip Webb
305055d6b1 Pass GenerationContext to customizeBeanRegistrationCodeFragments
Update `customizeBeanRegistrationCodeFragments` so that it can access
the `GenerationContext`.

See gh-28557
2022-06-05 18:59:02 -07:00
Phillip Webb
9a9c3ea00e Filter single inferred init/destroy methods
Update `BeanDefinitionPropertiesCodeGenerator` to not add
init/destroy method calls for a single inferred name.

Closes gh-28570
2022-06-05 16:14:40 -07:00
Phillip Webb
172102d225 Refine ApplicationContextAotGenerator class name generation
Refine the class name logic so that the name is passed in rather
than using `ApplicationContext.getId()`. Also propagate the name
so that the generated classes use it.

See gh-28565
2022-06-04 12:26:00 -07:00
Phillip Webb
4bd33cb6e0 Allow ApplicationContextAotGenerator to generated better class names
Update `ApplicationContextAotGenerator` so that it can generate class
names based on a `target` class and using the ID of the application
context. Prior to this commit, the generated class name was always
`__.BeanFactoryRegistrations`.

Closes gh-28565
2022-06-03 18:15:37 -07:00
Sam Brannen
243350054b Upgrade to AssertJ 3.23.1 2022-06-03 19:44:34 +02:00
Sébastien Deleuze
74c49c510a Use a single --initialize-at-build-time parameter per file
Closes gh-28563
2022-06-03 17:39:47 +02:00
Sam Brannen
92f8ab774f Stop initializing DataSize at build time for GraalVM
In light of gh-28560, this commit reverts the change made in gh-28328.

Closes gh-28562
2022-06-03 16:41:36 +02:00
Stephane Nicoll
3aefa88d3c Add test to validate AOT infrastructure registration
See gh-28561
2022-06-03 14:30:36 +02:00
Stephane Nicoll
176ea5e9a7 Fix registration of ScopedProxyBeanRegistrationAotProcessor
Closes gh-28561
2022-06-03 14:28:08 +02:00
Sam Brannen
0a7a53af6d Polish contribution
See gh-27609
2022-06-03 13:59:55 +02:00
Vedran Pavic
864dcf67d8 Simplify default locale/timezone resolution in cookie/session locale resolvers
At present, the customization of the default locale and timezone
resolution in CookieLocaleResolver and SessionLocaleResolver requires
subclassing them and overriding determineDefaultLocale and/or
determineDefaultTimeZone methods.

This commit simplifies resolution of the default locale and timezone
resolution by introducing dedicated functions for these purposes, thus
allowing customization without needing to resort to subclassing the
locale resolvers.

Closes gh-27609
2022-06-03 13:59:46 +02:00
Vedran Pavic
94cc2da33b Update LocaleContextResolver to implement LocaleResolver
This commit updates LocaleContextResolver to implement LocaleResolver
using default methods, which simplifies AbstractLocaleContextResolver
and aligns it more closely with AbstractLocaleResolver.

See gh-27609
2022-06-03 13:59:38 +02:00
Vedran Pavic
9a0eb8db28 Update AcceptHeaderLocaleResolver to extend AbstractLocaleResolver
This commit updates AcceptHeaderLocaleResolver to extend
AbstractLocaleResolver, which allows the removal of defaultLocale
managing code in AcceptHeaderLocaleResolver.

See gh-27609
2022-06-03 13:59:30 +02:00
Sam Brannen
73acab7635 Merge branch '5.3.x'
# Conflicts:
#	spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContextUtils.java
2022-06-03 13:35:22 +02:00
Sam Brannen
e2767371b5 Lazily initialize DataSize.PATTERN
To avoid unnecessary eager initialization of DataSize.PATTERN, this
commit initializes it lazily in the first invocation of DataSize.parse
by moving PATTERN to a private static nested class.

Closes gh-28560
2022-06-03 13:30:45 +02:00
Sam Brannen
aab9da0366 Polish LocaleResolver support 2022-06-03 13:10:55 +02:00
Stephane Nicoll
4191958e00 Merge pull request #28559 from neiser
* pr/28559:
  Polish "Improve AssertJ usage in cache config tests"
  Improve AssertJ usage in cache config tests

Closes gh-28559
2022-06-03 10:45:40 +02:00
Stephane Nicoll
baebf71ed7 Polish "Improve AssertJ usage in cache config tests"
See gh-28559
2022-06-03 10:33:01 +02:00
Andreas Grub
5ed0c848fe Improve AssertJ usage in cache config tests
See gh-28559
2022-06-03 10:15:36 +02:00
Phillip Webb
3ebdaeabd3 Publish spring-core-test
Closes gh-28558
2022-06-02 18:07:50 -07:00
Phillip Webb
8d79ec0b67 Allow AOT contributions to customize code fragments.
Update the `BeanRegistrationAotContribution` interface to allow
it to customize `BeanRegistrationCodeFragments`. This change
allows us to drop the `BeanRegistrationCodeFragmentsCustomizer`
interface since an `BeanRegistrationAotProcessor` can now be
used instead.

Closes gh-28557
2022-06-02 18:07:47 -07:00
Phillip Webb
74caa9213a Simplify SourceFileAssert assertion methods
Remove assertion methods that turned out not to be needed when
testing Spring Framework's AOT generated code.

Closes gh-28556
2022-06-02 18:01:39 -07:00
Rob Winch
5f4bcf197c BackportBot ignores pull-requests 2022-06-02 09:21:02 -05:00
Rob Winch
7fa15cde12 Escape GITHUB_EVENT argument to BackportBot 2022-06-02 09:21:02 -05:00
Stephane Nicoll
da8c4de263 Add AotDetector to reliably opt-in for optimizations
This commit adds a central utility to figure out if the application
must run with Ahead-Of-Time optimizations. This is mandatory for running
in a native image but can be selected on the JVM using the
"spring.aot.enabled" property.

This commit also introduces a utility that can be used to initialize a
context with generated artifacts. This represents the runtime
counterpart of ApplicationContextAotGenerator.

Closes gh-28474
2022-06-02 14:52:11 +02:00
Brian Clozel
8af1496b37 Expand hints conditions support in RuntimeHints
Prior to this commit, the hints conditions were only supported for the
`TypeHint` case. GraalVM generally expanded this concept to all hints
and we should do the same.

Right now, only the `typeReachable` condition is available but we should
design for possible future additions.

This commit introduces a new `ConditionalHint` contract implemented by
all hints compatible with this approach. The condition information is
also used in all configuration writers as a result.

Closes gh-28126
2022-06-02 11:35:03 +02:00
rstoyanchev
2269c0063a Restore base class of MissingServletRequestPartException
Effectively reverts commit #ad2722.

Closes gh-28455
2022-06-01 18:18:16 +01:00
rstoyanchev
cc56da7735 Support default methods in @HttpExchange interface
Closes gh-28491
2022-06-01 17:49:19 +01:00
Rob Winch
e2798560c7 Add BackportBot as GitHub Action 2022-06-01 10:21:25 -05:00
Sam Brannen
df45c80bfe Merge branch '5.3.x' 2022-06-01 16:30:44 +02:00
Sam Brannen
cda1e5507c Polishing 2022-06-01 16:28:05 +02:00
Balázs Póka
1d5ffaf30a Always construct new exception on error in DefaultWebClient
Always construct new exception on error, otherwise memory leak may
occur due to repeated use of singleton exception.

Closes gh-28550
2022-06-01 16:07:41 +02:00
Arjen Poutsma
8eb660b03c Merge branch '5.3.x' 2022-06-01 15:24:05 +02:00
Arjen Poutsma
c55606ed08 Recognize Kotlin coroutines in isAsyncVoidReturnType
This commit makes sure that Kotlin coroutines are correctly identified
by InvocableHandlerMethod::isAsyncVoidReturnType.

Closes gh-26829
2022-06-01 15:13:30 +02:00
Sam Brannen
bc3b3d01ee Polishing 2022-06-01 14:57:16 +02:00
Arjen Poutsma
d9d45cc0b1 Treat Reactive Publishers the same as Kotlin Flows
This commit makes sure that CoroutinesUtils::invokeSuspendingFunction
treats Reactive Publisher instances the same as Kotlin Flows, i.e.
it flatmaps them.

Closes gh-27011
2022-06-01 14:30:40 +02:00
Sam Brannen
279f9647ab Merge branch '5.3.x' 2022-05-31 16:14:16 +02:00
Sam Brannen
aa8802a81d Avoid new AssertJ deprecations 2022-05-31 16:13:31 +02:00
Sam Brannen
ee209de9cf Merge branch '5.3.x'
# Conflicts:
#	spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
#	spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewResolutionIntegrationTests.java
2022-05-31 14:15:36 +02:00