Commit Graph

2371 Commits

Author SHA1 Message Date
Rossen Stoyanchev
424e28bc35 Merge branch '5.2.x' into master 2020-10-15 17:18:33 +01:00
Rossen Stoyanchev
c45b106d95 Fix race issue and improve readAsynchronousFileChannel
Before this commit, ReadCompletionHandler delayed closing the channel
to allow an ongoing read to complete/fail so we can get a hold of the
associated DataBuffer and release it. This can be problematic since the
read take time to complete but even more importantly there was a race
condition where we didn't check if we've been disposed concurrently
while releasing the read flag.

This commit removes the delay and closes the channel immediately from
cancel() and that should in turn fail any ongoing read operation,
according to AsynchronousChannel, and the DataBuffer is released.

Further improvements include:
- combining the "reading" and "disposed" AtomicBoolean's into a
single "state" AtomicReference.
- an optimistic check to remain in READING mode and avoid state
switches when there is demand to continue reading.

Closes gh-25831
2020-10-15 17:10:22 +01:00
Sébastien Deleuze
33fcba55d1 Disable KotlinPropertyResolverExtensionsTests for now
Those tests produce intermittent build errors.
2020-10-13 16:19:01 +02:00
Sébastien Deleuze
3ed8813bbf Upgrade to Coroutines 1.4.0-M1 and use awaitSingle()
This commit raises the minimum Coroutines version supported
to 1.4.0-M1 and above, and changes usages of awaitFirst() or
awaitFirstOrNull() to awaitSingle() or awaitSingleOrNull()
to fix gh-25007.

Closes gh-25914
Closes gh-25007
2020-10-13 15:26:39 +02:00
Juergen Hoeller
7f365942a5 Nullability refinements and related polishing 2020-10-13 00:08:15 +02:00
Juergen Hoeller
ca2b412905 Merge branch '5.2.x' 2020-10-12 18:36:35 +02:00
Juergen Hoeller
66a67ec807 Polishing 2020-10-12 18:26:14 +02:00
Juergen Hoeller
21f2863d8e ControllerAdvice resolution detects @Order declared on @Bean method as well
Closes gh-25872
2020-10-12 18:07:17 +02:00
Juergen Hoeller
2a34c0ea70 Return early from composed Converter if initial conversion step returned null
See gh-23379
2020-10-12 18:07:17 +02:00
Rossen Stoyanchev
b9f7b0d955 Upgrade to Reactor 2020.0-RC2
See gh-25884
2020-10-12 14:26:51 +01:00
Rossen Stoyanchev
e73e489fd8 Remove use of MonoProcessor.fromSinks
See gh-25884
2020-10-09 20:46:21 +01:00
Sébastien Deleuze
94a42a3086 Support suspending handler methods in Spring MVC
This commit adds support for Kotlin Coroutines suspending functions to
Spring MVC, by converting those to a Mono that can then be handled by
the asynchronous request processing feature.

It also optimizes Coroutines detection with the introduction of an
optimized KotlinDetector.isSuspendingFunction() method that does not
require kotlin-reflect.

Closes gh-23611
2020-10-09 12:25:32 +02:00
Juergen Hoeller
d55c5b30d7 Merge branch '5.2.x' 2020-10-07 15:34:57 +02:00
Juergen Hoeller
ec9de943ee Construct StringBuilder in StreamUtils with appropriate initial size
Closes gh-25789
2020-10-07 15:11:53 +02:00
Philippe Marschall
cf61545f41 Add Dependencies Manifest Entry to spring-core
Add a Dependencies manifest entry with the value jdk.unsupported to
spring-core.
2020-10-06 15:45:49 +02:00
Сергей Цыпанов
8a04910bdd Drop explicit zeroing at instantiation of Atomic* objects 2020-10-06 15:45:12 +02:00
Juergen Hoeller
b7e1553c9d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java
2020-10-06 15:37:54 +02:00
Juergen Hoeller
1745a3f25d Consistent @Nullable declarations on overridden converter methods 2020-10-06 15:31:26 +02:00
Sam Brannen
a6bede22c1 Polish contribution
See gh-23379
2020-09-29 14:25:04 +02:00
Josh Cummings
a0c00362c3 Introduce Converter.andThen(...)
Closes gh-23379
2020-09-29 14:04:57 +02:00
Brian Clozel
e33e7d7681 Remove TestGroup.PERFORMANCE
Now that there's a new JMH infrastructure for benchmarks and that
performance tests have been rewritten to use it, we should remove the
`PERFORMANCE` `TestGroup` to avoid introducing such tests in the future.

Closes gh-24830
2020-09-25 13:43:38 +02:00
Brian Clozel
61d893257e Rewrite "performance" test to JMH benchmarks
This commit rewrites the remaining "fastEnough" performance tests into
proper JMH benchmarks.

See gh-24830
2020-09-25 13:43:38 +02:00
Juergen Hoeller
6c631e3d5c Merge branch '5.2.x'
# Conflicts:
#	spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java
2020-09-25 11:36:18 +02:00
Juergen Hoeller
6e4fcb69f0 Polishing 2020-09-25 11:26:01 +02:00
Juergen Hoeller
c04400890f Avoid repeated Charset resolution in MimeType
Closes gh-25808
2020-09-25 11:23:12 +02:00
Juergen Hoeller
9795883d91 Avoid repeated Charset resolution in MimeType
Closes gh-25808
2020-09-25 10:51:08 +02:00
Shenker93
ad5072a43c optimize StringUtils trimLeadingWhitespace() / trimTrailingWhitespace() & trimLeadingCharacter() / trimTrailingCharacter() utility methods 2020-09-25 10:44:02 +02:00
Juergen Hoeller
2a74f20c99 Merge branch '5.2.x' 2020-09-18 19:14:57 +02:00
Juergen Hoeller
f5d7161d6b Consistent flushing of given OutputStream 2020-09-18 19:14:11 +02:00
Juergen Hoeller
82e64af5a5 Avoid throwing plain RuntimeException (plus related polishing)
See gh-24805
2020-09-18 19:01:49 +02:00
Juergen Hoeller
bbe74635eb Merge branch '5.2.x' 2020-09-18 18:16:33 +02:00
Juergen Hoeller
9dfef59af2 Construct StringWriter instances with appropriate initial size
Closes gh-25789
2020-09-18 18:14:57 +02:00
Sam Brannen
9c8a8d82b9 Merge branch '5.2.x' 2020-09-15 17:18:39 +02:00
Sam Brannen
a6daed1b71 Fix example in Javadoc for Assert.notNull(object, messageSupplier)
Closes gh-25774
2020-09-15 16:27:21 +02:00
Sam Brannen
fe9f29f031 Suppress deprecation warning in AbstractDataBufferAllocatingTests 2020-09-15 14:34:41 +02:00
Rossen Stoyanchev
8b8b59bf80 Merge branch '5.2.x' into master 2020-09-15 11:37:00 +01:00
Rossen Stoyanchev
28df426798 Update AbstractDataBufferAllocatingTests
We are passing custom values to the constructor of PooledByteBufAllocator in
tests in order to turn of caching. This is based on:
https://github.com/netty/netty/issues/5275#issuecomment-220547057

Netty 4.1.52 has significant changes in PooledByteBufAllocator:
https://github.com/netty/netty/pull/10267

After the changes, our current value for maxOrder=2, which results in
chunkSize=16K, causes an assert failure in PoolChunk where the runSize
exceeds the chunkSize.
2020-09-15 11:31:59 +01:00
Juergen Hoeller
07b3e92bae Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	src/docs/asciidoc/core/core-aop-api.adoc
2020-09-14 22:22:02 +02:00
Juergen Hoeller
3c84863271 Polishing 2020-09-14 22:18:30 +02:00
Rossen Stoyanchev
bd277819fd Merge branch '5.2.x' into master 2020-09-14 15:43:38 +01:00
Rossen Stoyanchev
dccc78146a Expose defaultCharset in StringDecoder
Closes gh-25762
2020-09-14 14:28:02 +01:00
Rossen Stoyanchev
3295034839 Merge branch '5.2.x' into master 2020-09-13 21:30:02 +01:00
Rossen Stoyanchev
49356b2c0f SimpleIdGenerator rolls over at Long.MAX_VALUE
Closes gh-25485
2020-09-13 21:09:08 +01:00
Juergen Hoeller
a958633b7a Merge branch '5.2.x' 2020-09-08 17:09:58 +02:00
Juergen Hoeller
4d1d60ac42 Check log level before delegating Supplier-based message to target Log
Closes gh-25741
2020-09-08 16:50:40 +02:00
Brian Clozel
f7a014d7dc Improve MIME type subtype suffix handling
Prior to this commit, the subtype suffix of a MIME type (see RFC 6839)
was not properly taken into account when checking compatibility between
MIME types.

For example, `"application/*"` was not considered as compatible with
`"application/vnd.io.spring+json"`.

This commit adds a new `MimeType#getSubtypeSuffix()` method to easily
extract the subtype suffix information. This method is then reused in
the `isCompatibleWith` implementation to better handle these cases.

Fixes gh-25350
2020-09-08 14:46:48 +02:00
Juergen Hoeller
7dbb40ffa0 Merge branch '5.2.x' 2020-09-08 12:24:18 +02:00
Juergen Hoeller
c6cc6705ef FileUrlResource.isWritable() exclusively relies on getFile() implementation
Closes gh-25584
2020-09-08 12:23:27 +02:00
Juergen Hoeller
a93af329fc Fix javadoc typos (from ASM master)
See gh-24872
2020-09-07 17:55:41 +02:00
Juergen Hoeller
75f394ca85 Merge branch '5.2.x' 2020-09-07 17:54:51 +02:00