Commit Graph

31788 Commits

Author SHA1 Message Date
Sam Brannen
c405e742f4 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java
2022-10-07 12:39:24 +02:00
Sam Brannen
8caed88c14 Test status quo for URI/URL for scanned filesystem resources
See gh-29275
2022-10-07 12:17:27 +02:00
Stephane Nicoll
635534c1ad Describe naming conventions of GeneratedMethods#add
Closes gh-28997
2022-10-07 12:05:57 +02:00
Stephane Nicoll
c74760540d Polish 2022-10-07 11:42:55 +02:00
Sam Brannen
3dc60f1627 Backport changes to PathMatchingResourcePatternResolverTests 2022-10-07 11:01:02 +02:00
Brian Clozel
ca88eeb1ae Start building against Context Propagation 1.0.0 SNAPSHOTs 2022-10-07 08:38:14 +02:00
Stephane Nicoll
a16afe8e10 Describe the replacement use case for BeanRegistrationAotProcessor
Closes gh-29126
2022-10-06 16:42:17 +02:00
Juergen Hoeller
6027be5a39 Ignore overridden factory methods for unique candidate resolution
See gh-27920
2022-10-06 15:06:53 +02:00
Brian Clozel
455a736a01 Switch to Micrometer 1.10.0-SNAPSHOT
See gh-29241
2022-10-06 14:08:07 +02:00
Brian Clozel
6b0f6e9f27 Apply Gradle Test Retry plugin
The plugin is configured to detect flaky tests and retry them 3 times
when running on the CI, but still reports failures. This will provide a
standard way to detect flaky tests as failures and successful attempts
are shown in the tests report.
2022-10-06 13:54:28 +02:00
Iain Henderson
b8243e6f84 Support CBOR and Protobuf with Kotlin Serialization
This commit introduces support for CBOR and Protobuf using Kotlin
serialization. Support comes in the form of Encoder/Decoder as well
as HttpMessageConverters. Seperate abstract base classes supply support
for binary and string (de)serialization.

The exising JSON codecs and message converters have been migrated to
use the new base classes.

Closes gh-27628
2022-10-06 13:51:50 +02:00
rstoyanchev
b6c2e8de23 Support context propagation for Spring MVC controllers
Closes gh-29056
2022-10-06 12:43:54 +01:00
rstoyanchev
d581d48d24 Polishing ResponseBodyEmitterReturnValueHandlerTests 2022-10-06 12:43:54 +01:00
Stephane Nicoll
0d5c78d992 Polish 2022-10-06 13:33:58 +02:00
Juergen Hoeller
2a1807895e Upgrade to Tomcat 10.1 in web tests
Adapting to FileUpload API change: no FileItemFactory constructor argument anymore.
2022-10-06 12:33:56 +02:00
Juergen Hoeller
326335f903 Upgrade to Tomcat 10.1
Includes Jetty 11.0.12, Hibernate ORM 5.6.12, HtmlUnit 2.65
2022-10-06 12:09:05 +02:00
Juergen Hoeller
b45a48461f Polishing 2022-10-06 12:03:25 +02:00
Juergen Hoeller
aedef9321a Merge AOT constructor and factory method resolution into ConstructorResolver
This moves related code into the same class, unifies candidate determination for constructors and factory methods, and gets rid of the package cycle around the hard-coded Autowired annotation check (which is implicitly coming from AutowiredAnnotationBeanPostProcessor via the determineCandidateConstructors SPI now). The API entry point for AOT pre-resolution purposes is in RegisteredBean.

Closes gh-27920
2022-10-06 11:59:11 +02:00
Juergen Hoeller
3af0c232b7 ProxyFactoryBean determines actual proxy class in getObjectType()
AopProxy implementations accept empty Advisor chains for early proxy class creation.

Closes gh-29097
2022-10-06 11:54:06 +02:00
Stephane Nicoll
efaee61f31 Harmonize accessors of RuntimeHints API
Closes gh-29269
2022-10-06 09:36:17 +02:00
rstoyanchev
ffe2ba4c7b Undo constructor deprecation + polishing 2022-10-05 20:04:39 +01:00
Sam Brannen
30f1eee4d0 Polish Javadoc and implementation of ClassPathResource 2022-10-05 20:24:17 +02:00
Sam Brannen
61cc7c0a93 Prepare TestAotProcessor to make it abstract and remove the main() method
See gh-29266
2022-10-05 20:03:52 +02:00
Sam Brannen
05d6c4c9b2 Polishing 2022-10-05 20:02:44 +02:00
Sam Brannen
647e811e47 Restructure AopTestUtilsTests 2022-10-05 19:13:51 +02:00
Sam Brannen
66395502db Polishing 2022-10-05 19:06:15 +02:00
Sam Brannen
26e485ce40 Make TestClassScanner package private again
TestClassScanner was made public with the assumption that Spring Boot's
AOT testing support might need to work directly with that class; however,
it turns out that Spring Boot does not currently have such a need.

In light of that, this commit restores TestClassScanner's visibility to
package private.
2022-10-05 19:06:15 +02:00
Sam Brannen
98801f8a5b Consistently declare RuntimeHints parameter 1st in test AOT APIs 2022-10-05 19:06:15 +02:00
Sam Brannen
935265048a Simplify TestRuntimeHintsRegistrar API
Prior to this commit, the TestRuntimeHintsRegistrar API combined
processing of MergedContextConfiguration and test classes. However, it
appears that only spring-test internals have a need for registering
hints based on the MergedContextConfiguration. For example, Spring
Boot's AOT testing support has not had such a need, and it is assumed
that third parties likely will not have such a need.

In light of that, this commit simplifies the TestRuntimeHintsRegistrar
API so that it focuses on processing of a single test class.

In addition, this commit moves the hint registration code specific to
MergedContextConfiguration to an internal mechanism.

Closes gh-29264
2022-10-05 18:37:06 +02:00
Sam Brannen
7ad65b8dff Allocate more memory to Checkstyle tasks 2022-10-05 17:06:12 +02:00
Sam Brannen
8869ca27b1 Ensure ClassPathResources with same path have same hash code
This commit aligns the hashCode() implementation in ClassPathResource
with the recent change to the logic in equals().

See gh-29263
2022-10-05 16:58:08 +02:00
Sam Brannen
1082119c50 Polishing 2022-10-05 16:49:38 +02:00
Sam Brannen
a380ca2750 Ensure ClassPathResources with same path and ClassLoader are equal
Prior to this commit, if two ClassPathResource instances were
constructed differently (one from an absolute path and one from a path
relative to a Class) but had the same absolute path and the same
ClassLoader, they were effectively equal, but ClassPathResource#equals
returned false.

This commit addresses this by revising the logic in
ClassPathResource#equals accordingly.

Closes gh-29263
2022-10-05 16:27:02 +02:00
Sam Brannen
0aa9d9d535 Return URL-decoded file name from UrlResource#getFilename()
Prior to this commit, UrlResource#getFilename() returned the filename
of the resource URL-encoded which is in contrast to what
FileSystemResource#getFilename() returns for an equivalent resource.

In addition, users most likely expect that a filename returned from a
method defined in the Resource interface is unencoded.

This commit therefore revises UrlResource#getFilename() so that it
always returns the filename URL-decoded.

Closes gh-29261
2022-10-05 15:52:22 +02:00
Sam Brannen
084d7d1bdc Remove duplicate ClassPathResourceTests class 2022-10-05 15:52:22 +02:00
Sam Brannen
2e05137ff9 Polish PathResourceTests 2022-10-05 15:52:22 +02:00
Sam Brannen
f0556b6004 Undeprecate PathResourceTests 2022-10-05 15:52:22 +02:00
rstoyanchev
b08f185a0b Use MethodArgumentNotValidException for model attributes
Closes gh-29251
2022-10-05 14:02:42 +01:00
rstoyanchev
6b0f29a065 Document i8n for RFC 7807 problem details
Expand the documentation for error responses and add details on
using a MessageSource to customize and internationalize error details.

See gh-28814
2022-10-05 14:02:42 +01:00
rstoyanchev
75dea98811 Revise docs on RFC 7807
See gh-28814
2022-10-05 14:02:42 +01:00
rstoyanchev
a4210854fb MessageSource support for Spring MVC and WebFlux exceptions
See gh-28814
2022-10-05 14:02:42 +01:00
Sébastien Deleuze
ff81d64fb5 Add reflection hint for EmbeddedDataSourceProxy#shutdown
This commit adds a reflection hint on
EmbeddedDatabaseFactory$EmbeddedDataSourceProxy#shutdown when
EmbeddedDatabaseFactory is reachable in order to allow its usage
as bean destroy method.

Closes gh-29259
2022-10-05 14:08:09 +02:00
Brian Clozel
681cf0dae7 Provide full request URL for "http.url" keyvalue
Prior to this commit, the Observation filter for Servlet applications
would only use the request pathInfo as an "http.url" high cardinality
keyvalue. This commit ensures that we're using the full request URL as a
value there.

This also polishes gh-29254.

Fixes gh-29257
See gh-29254
2022-10-05 11:40:28 +02:00
Brian Clozel
7dd6afc263 Temporarily disable kotlin scripts tests with Java 19
See gh-29249
2022-10-05 10:04:24 +02:00
Brian Clozel
486a1b6024 Change keyvalue name to http.url in server observations
This commit changes the new high cardinality key value from
"uri.expanded" to "http.url" in order to align with the OTel
specification, since there is no need for backwards compatibility on
this new metadata.

Closes gh-29254
2022-10-05 09:55:42 +02:00
Stephane Nicoll
2f20d6322b Enable cglib proxy for configuration classes if necessary
This commit updates code generation to customize the instantiation of
a configuration class that requires a proxy. Rather than instantiating
the raw class, the proxy is used.

Closes gh-29107
2022-10-04 16:54:44 +02:00
Stephane Nicoll
f2e9d112b1 Fix TypeReference#getName for CGLIB proxies
This commit makes sure that the double '$' sign typically used by
generated cglib proxies are not used as an inner class separator.

Closes gh-29252
2022-10-04 16:49:13 +02:00
Stephane Nicoll
9820e3341d Fix handling of protected visibility
Previously, InstanceSupplierCodeGenerator used reflection if the target
visibility is either protected or private, and use direct access if the
target visibility is public or package private.

The previous arrangement already assumed that the code is generateed in
the same package as the target type. This means that protected can be
used as well so this commit only use reflection if the target visibility
is private.

Closes gh-29253
2022-10-04 16:49:13 +02:00
Sam Brannen
1224be84ba Remove incorrect [@]since tags 2022-10-04 16:24:13 +02:00
Sam Brannen
e284405e9a Delete unused code 2022-10-04 16:19:53 +02:00