Commit Graph

23390 Commits

Author SHA1 Message Date
Sam Brannen
452f1b877c Consider return type of static methods in ObjectToObjectConverter
Prior to this commit, ObjectToObjectConverter considered the return
type of non-static `to[targetType.simpleName]()` methods but did not
consider the return type of static `valueOf(sourceType)`,
`of(sourceType)`, and `from(sourceType)` methods.

This led to scenarios in which `canConvert()` returned `true`, but a
subsequent `convert()` invocation resulted in a
ConverterNotFoundException, which violates the contract of the
converter.

This commit addresses this issue by taking into account the return type
of a static valueOf/of/from factory method when determining if the
ObjectToObjectConverter supports a particular conversion. Whereas the
existing check in `determineToMethod()` ensures that the method return
type is assignable to the `targetType`, the new check in
`determineFactoryMethod()` leniently ensures that the method return
type and `targetType` are "related" (i.e., reside in the same type
hierarchy).

Closes gh-28609
2022-06-13 17:20:18 +02:00
Arjen Poutsma
c278d8c656 Do not ignore charset in Jaxb2XmlDecoder
This commit makes sure that the charset, if defined in the mimetype, is
used when decoding XML to JAXB2 objects.

Closes gh-28599
2022-06-13 13:47:31 +02:00
Stephane Nicoll
e3b288716d Upgrade to Reactor 2020.0.20
Closes gh-28612
2022-06-13 11:39:15 +02:00
Arjen Poutsma
27738cc20f Fix code samples for nested router functions
Closes gh-28603
2022-06-10 13:36:33 +02:00
Sam Brannen
babff8e635 Fix Kotlin example for dependency injection with static factory method
Closes gh-28589
2022-06-09 13:16:19 +02:00
Sam Brannen
290cc73d3d Fix Kotlin example for @Required
Since @Required can only be declared on a method, this commit moves the
@Required declaration from the field to the "set" method.

Closes gh-28590
2022-06-09 13:13:43 +02:00
Stephane Nicoll
8a30bc2993 Upgrade Java 18 version in CI image 2022-06-09 08:14:54 +02:00
Stephane Nicoll
aa8be28a01 Upgrade Java 17 version in CI image 2022-06-09 08:14:30 +02:00
Stephane Nicoll
f43b28e7ba Upgrade Java 11 version in CI image 2022-06-09 08:14:05 +02:00
Stephane Nicoll
1476867ee7 Upgrade Java 18 version in CI image 2022-06-09 08:13:36 +02:00
Stephane Nicoll
4d9dc61f5d Polish 2022-06-09 08:13:12 +02:00
Stephane Nicoll
7eebc48a6e Upgrade Ubuntu version in CI image 2022-06-09 08:11:36 +02:00
Sam Brannen
8478e8e70a Polish contribution
This commit:

- fixes Checkstyle violations
- improves Javadoc
- adds missing @since tags
- renames getCurrentQueueSize() to getQueueSize()
- avoids NullPointerExceptions in getQueueSize()
- introduces tests for queue size and queue capacity

Closes gh-28583
2022-06-08 16:39:10 +02:00
Rémy
e386bdb82c Expose ThreadPoolTaskExecutor queue size and capacity for metrics
We use Grafana to monitor our app via Spring's JMX exporter, and we
think it could be interesting to have at least the current queue size
for this purpose since the queue size directly affects the app memory
load. Having the queue capacity seems also interesting to set up
triggers whose values are calculated based on the maximum capacity of
the queue.

This commit introduces new getCurrentQueueSize() and getQueueCapacity()
methods in ThreadPoolTaskExecutor.

See gh-28583
2022-06-08 16:39:00 +02:00
Arjen Poutsma
4912c3c455 Updated sdkmanrc 2022-06-08 12:13:21 +02:00
rstoyanchev
8fcc7ab9d1 CompositeLog respects log level changes at runtime
Closes gh-28477
2022-06-08 10:07:52 +01:00
rstoyanchev
7c47b470ff MockMvc allows HttpMethod input for multipart request
Closes gh-28545
2022-06-08 10:07:52 +01:00
Sam Brannen
479ef3f3fd Update documentation regarding nested test class support
Closes gh-28579
2022-06-08 09:52:42 +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
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
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
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
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
aa8802a81d Avoid new AssertJ deprecations 2022-05-31 16:13:31 +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
8547f8601d Polish LocaleResolver tests 2022-05-31 11:55:30 +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
a221835558 Throw IllegalStateException for invalid port in HierarchicalUriComponents
Prior to this commit, getPort() in HierarchicalUriComponents threw a
NumberFormatException for an invalid port supplied as a String, which
was inconsistent with exception handling elsewhere in the class as well
as within the same method.

This commit introduces a try-catch block in getPort() to consistently
throw IllegalStateExceptions for ports that cannot be parsed.

Closes gh-28521
2022-05-25 11:29:12 +02:00
Sam Brannen
aa06a09dee Polishing 2022-05-25 11:29:12 +02:00
hsteinmueller
bde0931e51 Fix Javadoc for DatabaseClient
The documentation for DatabaseClient had misplaced double quotes in the
example on how to map a select statement to a row.

Closes gh-28520
2022-05-24 17:15:44 +02:00
Sam Brannen
7b95c928d1 Fix Javadoc for ResourcePatternResolver 2022-05-23 20:32:01 +02:00
Sam Brannen
53f88d455f Fix Javadoc for AbstractFileResolvingResource.isFile(URI) 2022-05-23 20:32:01 +02:00
Sam Brannen
53a506f6bb Polishing 2022-05-23 20:22:37 +02:00
rstoyanchev
f95bf96ec9 Correct path encoding/decoding in PathResourceResolver
Decoding is required for non-UrlResource when the HandlerMapping is
not expected to decode the path. Encoding is the opposite.

This commit ensures correct determination of whether the HandlerMapping
is expected to have decoded the path or not that in turn depends on
whether PathPattern or PathMatcher is in use.

Closes gh-27791
2022-05-23 11:03:42 +01:00
rstoyanchev
66a5742df3 Polishing 2022-05-23 10:07:03 +01:00
Sam Brannen
59c7bb1f86 Use Arrays.toString instead of Arrays.asList when generating Strings 2022-05-17 15:36:31 +02:00
Sam Brannen
a1c3efbb5f Polish ManagedList[Tests] and ManagedSet[Tests] 2022-05-17 15:36:31 +02:00
Sam Brannen
6efe3aee34 Polishing 2022-05-16 11:20:20 +02:00
Sam Brannen
f2fe7f335c Improve nullReturningBeanPostProcessor() test
See gh-28459
2022-05-14 18:30:39 +02:00
Sam Brannen
48c797e429 Fix Kotlin example for static factory method
Closes gh-28399
2022-05-11 17:33:31 +02:00
Sam Brannen
be782a2197 Polish ref docs regarding the BeanFactory API
See gh-28403
2022-05-11 17:16:40 +02:00
Sam Brannen
8098e45bad Sync gradle.properties between 5.3.x and main 2022-05-11 16:30:44 +02:00
Sam Brannen
06679a5583 Fix tests in DispatcherServletTests
See gh-28424
2022-05-11 16:00:26 +02:00