Commit Graph

23675 Commits

Author SHA1 Message Date
Brian Clozel
bfe9d4fc49 Merge branch '5.3.x' 2022-02-14 16:23:49 +01:00
Brian Clozel
88f73bffa0 Make assertion message lazy in ServletRequestPathUtils
Closes gh-27946
2022-02-14 16:21:41 +01:00
Brian Clozel
4c410cbe54 Remove toolchain configuration for Kotlin
Kotlin currently only supports JDK17 language level, which is our
minimum requirement so far.
This commit simplifies the toolchain setup until this is needed again.

See 303e363adf
2022-02-14 13:04:09 +01:00
rstoyanchev
7ecfce2386 Polishing contribution
See gh-27948
2022-02-14 11:26:40 +00:00
heowc
ad2722b3a3 MissingServletRequestPartException extends ServletRequestBindingException
Closes gh-27948
2022-02-14 11:26:40 +00:00
Brian Clozel
303e363adf Configure Gradle JVM toolchain for Kotlin tasks 2022-02-14 11:47:16 +01:00
Brian Clozel
2a0ec0b2dd Merge branch '5.3.x' 2022-02-14 10:56:44 +01:00
Brian Clozel
0ab054c7b9 Upgrade concourse-release-scripts in CI
This commit also reverts the change of resource type for the publication
of the CI image and fixes a bug in the CI image setup with available
JDKs.
2022-02-14 10:55:07 +01:00
Sébastien Deleuze
5e64081ed1 Merge branch '5.3.x' 2022-02-14 10:51:46 +01:00
Sébastien Deleuze
8eb618b480 Make Kotlin functions accessible in CoroutinesUtils
In order to allow using private classes like in Java
for example.

Closes gh-23840
2022-02-14 10:43:31 +01:00
Brian Clozel
70269addb7 Merge branch '5.3.x' 2022-02-14 10:38:41 +01:00
Brian Clozel
2f78abd56e Upgrade CI pipeline
This commit upgrades the CI pipeline with the following:

* replace JDK16 with JDK17 as build variant
* upgrade all JDK versions
* replace docker-image with registry-image resource for CI image
2022-02-14 10:29:45 +01:00
Sam Brannen
e6ce328be4 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/AnnotationTypeMappingsTests.java
2022-02-13 00:00:11 +01:00
Sam Brannen
3ec612aaf8 Support recursive annotations in merged annotations
Although Java does not allow the definition of recursive annotations,
Kotlin does, and prior to this commit an attempt to synthesize a
merged annotation using the MergedAnnotation API resulted in a
StackOverflowError if there was a recursive cycle in the annotation
definitions.

This commit addresses this issue by tracking which annotations have
already been visited and short circuits the recursive algorithm if a
cycle is detected.

Closes gh-28012
2022-02-12 23:42:57 +01:00
Sam Brannen
7b0443333d Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-02-11 20:44:42 +01:00
Sam Brannen
4eaee1e738 Short circuit if-conditions in AttributeMethods 2022-02-11 20:41:23 +01:00
Sébastien Deleuze
eca755ec88 Upgrade to Dokka 1.6.10
Closes gh-28040
2022-02-11 17:42:06 +01:00
Stephane Nicoll
37b03aee82 Merge branch '5.3.x' 2022-02-11 15:49:53 +01:00
Stephane Nicoll
4201479546 Start building against Reactor 2020.0.16 snapshots
See gh-28039
2022-02-11 15:41:49 +01:00
Sam Brannen
a4e192e33d Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java
2022-02-11 15:38:54 +01:00
Sam Brannen
b60340b102 Simplify tests for synthesized annotation toString()
See gh-28015
2022-02-11 15:33:14 +01:00
Sam Brannen
5ae9217271 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/annotation/SynthesizedMergedAnnotationInvocationHandler.java
#	src/eclipse/org.eclipse.jdt.ui.prefs
2022-02-11 15:01:47 +01:00
Brian Clozel
7257f31ca8 Upgrade Dokka to 1.6.10 2022-02-11 13:58:56 +01:00
Brian Clozel
6c42bcfaec Upgrade to Kotlin 1.6.20-M1
This commit upgrades the Kotlin dependencies to 1.6.20-M1 and configures
the build to generate Java 17 bytecode for Kotlin classes.

Closes gh-27814
2022-02-11 11:39:32 +01:00
Brian Clozel
2019e176ee Upgrade to AspectJ 1.9.8
This commit also upgades the dedicated Gradle plugin for AspectJ build
integration.

Closes gh-27416
2022-02-11 11:13:52 +01:00
Sam Brannen
2fd39839f8 Improve toString() for synthesized annotations
Although the initial report in gh-28015 only covered inconsistencies
for arrays and strings in the toString() implementations for
annotations between the JDK (after Java 9) and Spring, it has since
come to our attention that there was further room for improvement.

This commit therefore addresses the following in toString() output for
synthesized annotations.

- characters are now wrapped in single quotes.

- bytes are now properly formatted as "(byte) 0x##".

- long, float, and double values are now appended with "L", "f", and
  "d", respectively. The use of lowercase for "f" and "d" is solely to
  align with the choice made by the JDK team.

However, this commit does not address the following issues which we may
choose to address at a later point in time.

- non-ASCII, non-visible, and non-printable characters within a
  character or String literal are not escaped.

- formatting for float and double values does not take into account
  whether a value is not a number (NaN) or infinite.

Closes gh-28015
2022-02-10 17:14:37 +01:00
Sam Brannen
ce87285be5 Use canonical names for types in synthesized annotation toString
My proposal for the same change in the JDK is currently targeted for
JDK 19.

- https://bugs.openjdk.java.net/browse/JDK-8281462
- https://bugs.openjdk.java.net/browse/JDK-8281568
- https://github.com/openjdk/jdk/pull/7418

See gh-28015
2022-02-10 16:59:00 +01:00
Stephane Nicoll
1a4573641d Add code contribution infrastructure
This commit adds an API that lets individual components contribute code,
runtime hints, and protected access information. This ease the cases
where code need to be written in a privileged package if necessary and
let contributors provide hints for the code they generate.

Closes gh-28030
2022-02-10 15:54:43 +01:00
Stephane Nicoll
d64f8c1a05 Make BeanDefinitionValueResolver public
Closes gh-28029
2022-02-10 15:01:58 +01:00
Stephane Nicoll
b3ceb0f625 Add core JavaPoet utilities
This commit adds utilities that facilitate code generation patterns
used by the AOT engine.

Closes gh-28028
2022-02-10 14:58:04 +01:00
Stephane Nicoll
dfae8effa8 Repackage Javapoet in org.springframework.javapoet
This commit repackages the Javapoet library into spring-core so that it
can be used by the AOT engine without requiring a specific version.

Closes gh-27828
2022-02-10 14:56:36 +01:00
Sam Brannen
97582fd0a1 Update Eclipse template to @since 5.3.16 2022-02-10 13:43:02 +01:00
Stephane Nicoll
7a2c9b80c2 Merge branch '5.3.x' 2022-02-10 13:15:39 +01:00
Stephane Nicoll
d2c7dfb79e Add convenience factory method for Managed[List|Set|Map]
Closes gh-28026
2022-02-10 12:37:19 +01:00
Sam Brannen
5c60a721a7 Upgrade to Gradle 7.4
Closes gh-28020
2022-02-08 16:26:37 +01:00
Sam Brannen
1deb6b04b8 Apply "instanceof pattern matching" in SynthesizedMergedAnnotationInvocationHandler 2022-02-08 14:30:26 +01:00
Sam Brannen
839cc5f7f8 Remove unnecessary JDK 9+ check in MergedAnnotationsTests 2022-02-08 14:19:32 +01:00
Sam Brannen
bf40033e86 Merge branch '5.3.x' 2022-02-08 14:15:25 +01:00
Sam Brannen
7139a877f4 Ensure toString() for synthesized annotations is source code compatible
Since the introduction of synthesized annotation support in Spring
Framework 4.2 (a.k.a., merged annotations), the toString()
implementation attempted to align with the formatting used by the JDK
itself. However, Class annotation attributes were formatted using
Class#getName in Spring; whereas, the JDK used Class#toString up until
JDK 9.

In addition, JDK 9 introduced new formatting for toString() for
annotations, apparently intended to align with the syntax used in the
source code declaration of the annotation. However, JDK 9+ formats enum
annotation attributes using Enum#toString instead of Enum#name, which
can lead to issues if toString() is overridden in an enum.

This commit updates the formatting used for synthesized annotations by
ensuring that toString() generates a string that is compatible with the
syntax of the originating source code, going beyond the changes made in
JDK 9 by using Enum#name instead of Enum#toString.

Closes gh-28015
2022-02-08 14:10:36 +01:00
Sam Brannen
669b05dc1d Allow AutowiredAnnotationBeanPostProcessor to compile on JDK 11 2022-02-08 14:06:27 +01:00
Stephane Nicoll
a0c97e4c36 Polish
See gh-27829
2022-02-07 12:51:53 +01:00
Stephane Nicoll
6936f7e0cb Relocate runtime hints to aot package
See gh-27829
2022-02-07 12:51:43 +01:00
Sam Brannen
e077a753f8 Polish JsonContentTests 2022-02-05 20:37:42 +01:00
Sam Brannen
2ae6431a50 Merge branch '5.3.x' 2022-02-05 20:26:10 +01:00
Sam Brannen
038b88e2a1 Polishing 2022-02-05 20:23:45 +01:00
Sam Brannen
eb84c84373 Polish contribution
See gh-27993
2022-02-05 20:15:30 +01:00
Gleidson Leopoldo
920be8e1b2 Add support for strict JSON comparison in WebTestClient
Prior to this commit, WebTestClient only supported "lenient" comparison
of the expected JSON body.

This commit introduces an overloaded variant of `json()` in the
BodyContentSpec that accepts an additional boolean flag to specify
whether a "strict" comparison should be performed.

This new feature is analogous to the existing support in MockMvc.

Closes gh-27993
2022-02-05 20:15:30 +01:00
Sam Brannen
a13ad3e969 Polishing 2022-02-05 20:15:30 +01:00
Sam Brannen
04fbfddb13 Polish contribution
See gh-28011
2022-02-05 19:12:13 +01:00
lijun695
1e0e477833 Apply "instanceof pattern matching" in AbstractRoutingDataSource
Closes gh-28011
2022-02-05 18:58:08 +01:00