Commit Graph

24828 Commits

Author SHA1 Message Date
Brian Clozel 270b167e08 Upgrade registry-image-resource in CI pipeline to 1.5.0
See spring-projects/spring-boot#30408
2022-04-04 19:01:03 +02:00
Brian Clozel 705bf78104 Consistently handle match with '*' and trailing slash
Prior to this commit, the `AntPathMatcher` would inconsistently match
pattern with trailing slashes if they contain `"**"` within their
pattern.

For example `"/en/test/"` would match `"/**/test"`, but it would not
match `"/*/test"` (as it should).

This commit fixes this behavior for better consistency.

Fixes gh-27506
2022-04-04 18:51:03 +02:00
Brian Clozel 1776f08bfe Merge branch '5.3.x' 2022-04-04 18:37:16 +02:00
GatinMI b158110801 Fix debug log for no matching acceptableTypes 2022-04-04 18:29:01 +02:00
Sébastien Deleuze e0090545f5 Upgrade Kotlin to 1.6.20
Closes gh-28036
2022-04-04 15:16:04 +02:00
Stephane Nicoll 0267da8d2e Polish 2022-04-04 13:52:22 +02:00
Brian Clozel f447f9cd39 Upgrade to JDK 18 GA in CI image 2022-04-04 10:40:10 +02:00
Brian Clozel fd1346bf66 Merge branch '5.3.x' 2022-04-01 19:25:11 +02:00
Brian Clozel 17f7a24118 Add application/graphql+json mime and media types
Closes gh-28271
2022-04-01 19:24:55 +02:00
rstoyanchev aea39fdad3 Merge branch '5.3.x' into main 2022-04-01 17:57:48 +01:00
rstoyanchev d518a7d8c8 AbstractListenerReadPublisher continues after 0 bytes
If we read 0 bytes, e.g. chunked encoding markup read but not the
actual data within it, don't stop reading since the server may or
may not consider it necessary to call onDataAvailable again.
Instead, we keep on reading, and although isReady likely returns
false on the next iteration, it eliminates ambiguity and ensures
the server will call onDataAvailable when more data arrives.

Closes gh-28241
2022-04-01 17:38:03 +01:00
rstoyanchev 24cd3c1f4c Revert "Disable flaky integration tests for now"
This reverts commit 1627f57f1f in
preparation for fixing the root cause
2022-04-01 16:07:05 +01:00
Spring Builds 2a8c369cff Next development version (v5.3.19-SNAPSHOT) 2022-03-31 09:04:49 +00:00
Brian Clozel afbff391d8 Merge branch '5.3.x' 2022-03-31 10:33:51 +02:00
Brian Clozel 002546b3e4 Refine PropertyDescriptor filtering
Restrict property paths under `Class` and properties of types
`ClassLoader` or `ProtectionDomain`.
2022-03-31 10:21:30 +02:00
Stephane Nicoll 9ea741364a Merge branch '5.3.x' 2022-03-31 09:47:29 +02:00
Stephane Nicoll 1627f57f1f Disable flaky integration tests for now 2022-03-31 09:46:36 +02:00
Sam Brannen 02d3e00d33 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/SerializationUtils.java
2022-03-29 15:28:19 +02:00
Sam Brannen 3811cd4c0a Introduce warnings in documentation of SerializationUtils
Closes gh-28246
2022-03-29 15:22:30 +02:00
Sam Brannen 7a1421cb0f Suppress deprecation warnings in tests 2022-03-29 15:04:58 +02:00
Sam Brannen c8d0146bcc Polish contribution
See gh-28075
2022-03-29 13:39:40 +02:00
Loïc Ledoyen 7f7fb58dd0 Deprecate SerializationUtils#deserialize
Since SerializationUtils#deserialize is based on Java's serialization
mechanism, it can be the source of Remote Code Execution (RCE)
vulnerabilities.

Closes gh-28075
2022-03-29 13:07:36 +02:00
Sébastien Deleuze e681e713d4 Initialize NativeDetector at build time
Closes gh-28244
2022-03-29 08:50:41 +02:00
Sébastien Deleuze 77a8cbcbec Remove outdated comment in NativeDetector
`-H:+InlineBeforeAnalysis` is enabled by default as of
GraalVM 21.3.
2022-03-29 08:32:02 +02:00
Sam Brannen 50973f73c7 Change link from 5.3.x to main
See gh-28228
2022-03-27 17:47:41 +02:00
Sam Brannen e88a88cb7d Merge branch '5.3.x' 2022-03-27 17:46:39 +02:00
Sam Brannen d927e37364 Add "Testing ORM entity lifecycle callbacks" note to Testing chapter
Closes gh-28228
2022-03-27 17:46:06 +02:00
Sam Brannen e90225336a Use JPA from Jakarta 2022-03-27 17:01:26 +02:00
Sam Brannen 5eff9f8d7e Merge branch '5.3.x' 2022-03-27 16:53:31 +02:00
Sam Brannen 1d302bf384 Introduce tests for gh-28228 2022-03-27 16:29:45 +02:00
Stephane Nicoll defcaae6e4 Merge branch '5.3.x' 2022-03-27 10:05:47 +02:00
Stephane Nicoll 4b150fd451 Update copyright date in reference manual
Closes gh-28237
2022-03-27 09:59:12 +02:00
Stephane Nicoll 890fa1145f Merge branch '5.3.x' 2022-03-27 09:57:47 +02:00
Stephane Nicoll 3a6016d356 Merge pull request #28238 from izeye
* pr/28238:
  Update copyright year of EvaluationTests

Closes gh-28238
2022-03-27 09:56:45 +02:00
izeye 135506f672 Update copyright year of EvaluationTests
See gh-28238
2022-03-27 09:55:58 +02:00
Juergen Hoeller e59f39f2cc Upgrade to AspectJ 1.9.9, Caffeine 3.0.6, Hibernate ORM 5.6.7 2022-03-25 18:18:31 +01:00
Juergen Hoeller 12d8010395 Merge branch '5.3.x' 2022-03-25 18:08:55 +01:00
Juergen Hoeller cb36ca31f6 Upgrade to ASM master 2022-03-25 18:07:12 +01:00
Juergen Hoeller edd66d96dd Fix accidental use of deprecated setFlushMode method
Closes gh-28234
2022-03-25 18:06:39 +01:00
Juergen Hoeller 35610a535d Expose cancel(mayInterruptIfRunning) variant in ScheduledTask
Closes gh-28233
2022-03-25 18:06:31 +01:00
Sam Brannen 42a61b966b Remove TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy for MergedAnnotations
This commit removes the deprecated TYPE_HIERARCHY_AND_ENCLOSING_CLASSES
search strategy from the MergedAnnotations model.

As a direct replacement for the TYPE_HIERARCHY_AND_ENCLOSING_CLASSES
search strategy, users can use the new fluent search API as follows.

MergedAnnotations mergedAnnotations =
   MergedAnnotations.search(TYPE_HIERARCHY)
      .withEnclosingClasses(clazz -> true) // always search enclosing classes
      .from(MyClass.class);

Note, however, that users are highly encouraged to use
ClassUtils::isInnerClass, ClassUtils::isStaticClass, or a custom
predicate other than `clazz -> true`.

Closes gh-28080
2022-03-24 16:31:12 +01:00
Sam Brannen 1fe394f11d Introduce predicate for searching enclosing classes in MergedAnnotations
Due to the deprecation of the TYPE_HIERARCHY_AND_ENCLOSING_CLASSES
search strategy (see gh-28079), this commit introduces a way for users
to provide a Predicate<Class<?>> that is used to decide when the
enclosing class for the class supplied to the predicate should be
searched.

This gives the user complete control over the "enclosing classes"
aspect of the search algorithm in MergedAnnotations.

- To achieve the same behavior as TYPE_HIERARCHY_AND_ENCLOSING_CLASSES,
  a user can provide `clazz -> true` as the predicate.

- To limit the enclosing class search to inner classes, a user can
  provide `ClassUtils::isInnerClass` as the predicate.

- To limit the enclosing class search to static nested classes, a user
  can provide `ClassUtils::isStaticClass` as the predicate.

- For more advanced use cases, the user can provide a custom predicate.

For example, the following performs a search on MyInnerClass within the
entire type hierarchy and enclosing class hierarchy of that class.

MergedAnnotations mergedAnnotations =
   MergedAnnotations.search(TYPE_HIERARCHY)
      .withEnclosingClasses(ClassUtils::isInnerClass)
      .from(MyInnerClass.class);

In addition, TestContextAnnotationUtils in spring-test has been
revised to use this new feature where feasible.

Closes gh-28207
2022-03-24 15:40:44 +01:00
Brian Clozel 7161940b53 Merge branch '5.3.x' 2022-03-24 13:44:38 +01:00
Yanming Zhou acf2955b96 Ban jetbrains annotations imports
Closes gh-28226
2022-03-24 13:31:36 +01:00
Arjen Poutsma 72e7ae60d4 Polish Javadoc for AbstractClientHttpResponse 2022-03-23 16:00:15 +01:00
Sam Brannen 6cc685034e Polishing 2022-03-23 15:18:56 +01:00
Arjen Poutsma 28ac0d3883 Use HttpStatusCode interface
This commit contains changes made because of the introduction of
HttpStatusCode. In general, methods that used to return a HttpStatus
now return HttpStatusCode instead, and methods that returned raw status
codes are now deprecated.

See gh-28214
2022-03-23 12:49:38 +01:00
Arjen Poutsma ca4b6e86a4 Introduce HttpStatusCode interface
This commit introduces HttpStatusCode, an interface implemented by
HttpStatus. Instances of HttpStatusCode are obtained via static
valueOf(int) factory method, returning a HttpStatus enum entry if
available, and a default implementation otherwise.

The underlying reason behind this change is HTTP status codes are not
enumerable, but instead range from 100-999.

Closes gh-28214
2022-03-23 11:35:57 +01:00
Sam Brannen c23edf7da6 Introduce fluent API for searches in MergedAnnotations
Prior to this commit, searching for merged annotations on an
AnnotatedElement in the MergedAnnotations model was only supported via
various overloaded from(...) factory methods. In addition, it was not
possible to provide a custom AnnotationFilter without providing an
instance of RepeatableContainers.

This commit introduces a fluent API for searches in MergedAnnotations
to address these issues and improve the programming model for users of
MergedAnnotations.

To begin a search, invoke MergedAnnotations.search(SearchStrategy) with
the desired search strategy. Optional configuration can then be
provided via one of the with(...) methods. To perform a search, invoke
from(AnnotatedElement), supplying the element from which to begin the
search -- for example, a Class or a Method.

For example, the following performs a search on MyClass within the
entire type hierarchy of that class while ignoring repeatable
annotations.

MergedAnnotations mergedAnnotations =
    MergedAnnotations.search(SearchStrategy.TYPE_HIERARCHY)
        .withRepeatableContainers(RepeatableContainers.none())
        .from(MyClass.class);

To reuse search configuration to perform the same type of search on
multiple elements, you can save the Search instance as demonstrated in
the following example.

Search search = MergedAnnotations.search(SearchStrategy.TYPE_HIERARCHY)
                    .withRepeatableContainers(RepeatableContainers.none());

MergedAnnotations mergedAnnotations = search.from(MyClass.class);
// do something with the MergedAnnotations for MyClass
mergedAnnotations = search.from(AnotherClass.class);
// do something with the MergedAnnotations for AnotherClass

In addition, this fluent search API paves the way for introducing
support for a predicate that controls the search on enclosing classes
(gh-28207) and subsequently for completely removing the
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES search strategy (gh-28080).

Closes gh-28208
2022-03-22 20:01:24 +01:00
Stephane Nicoll 565ffd129a Merge pull request #28217 from izeye
* pr/28217:
  Add Javadoc since for BeanDefinitionValueResolver.resolveInnerBean()

Closes gh-28217
2022-03-22 16:53:06 +01:00