Commit Graph

24261 Commits

Author SHA1 Message Date
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
Sam Brannen
1beb7068f6 Use new AssertJ exception assertions 2022-05-31 14:08:28 +02:00
Sam Brannen
9d324e59a0 Upgrade to AssertJ 3.23.0 2022-05-31 12:55:43 +02:00
Sam Brannen
b659030867 Merge branch '5.3.x' 2022-05-31 12:01:39 +02:00
Sam Brannen
8547f8601d Polish LocaleResolver tests 2022-05-31 11:55:30 +02:00
Stephane Nicoll
a46b71a4b9 Merge branch '5.3.x' 2022-05-31 10:01:50 +02:00
Stephane Nicoll
40cb81470b Merge pull request #28542 from eltociear
* pr/28542:
  Fix typo in webflux.adoc

Closes gh-28542
2022-05-31 10:01:30 +02:00
Ikko Ashimine
6e3b3c5419 Fix typo in webflux.adoc
See gh-28542
2022-05-31 10:01:13 +02:00
Sam Brannen
a3ee27bb4d Polishing 2022-05-30 20:00:07 +02:00
Sam Brannen
b79f981510 Document Checkstyle issue regarding instanceof pattern variables
See https://github.com/checkstyle/checkstyle/issues/10969
2022-05-30 19:58:21 +02:00
Sam Brannen
16f65e59b4 Polish contribution
See gh-28188
2022-05-30 19:35:28 +02:00
Sam Brannen
43dd813ee6 Temporary workaround for Checkstyle bug
Attempting to name a variable in an "instanceof pattern" the same as
a field results in a Checkstyle violation similar to the following if
the "instanceof pattern matching" is located within a constructor.

Reference to instance variable 'document' needs "this.". [RequireThis]

See gh-28188
2022-05-30 19:35:28 +02:00
diguage
bbaf7578b2 Apply "instanceof pattern matching" in spring-core
Closes gh-28188
2022-05-30 19:29:48 +02:00
Sam Brannen
720261db26 Use List.of() and Set.of() where feasible 2022-05-30 18:42:48 +02:00
Sam Brannen
ad46f0295c Apply "instanceof pattern matching" 2022-05-30 18:41:25 +02:00