Commit Graph

2388 Commits

Author SHA1 Message Date
Sam Brannen d1e6883d5d Fix issues in Javadoc 2020-10-27 11:05:31 +01:00
Sam Brannen 705cf09ad7 Merge branch '5.2.x' 2020-10-26 15:05:35 +01:00
Sam Brannen 449377908f Fix JUnit 4 to AssertJ migration bugs
The migration from JUnit 4 assertions to AssertJ assertions resulted in
several unnecessary casts from int to long that actually cause
assertions to pass when they should otherwise fail.

This commit fixes all such bugs for the pattern `.isNotEqualTo((long)`.
2020-10-26 14:53:09 +01:00
Juergen Hoeller 82835b99ec Restore independent LinkedMultiValueMap implementation (without base class)
Closes gh-25960
2020-10-26 11:16:33 +01:00
Juergen Hoeller a3f3a136c4 Make MultiValueMapAdapter public (as base class for LinkedMultiValueMap)
Closes gh-25960
2020-10-26 10:41:59 +01:00
Juergen Hoeller 73eefeac5f Expose contains, remove and clear methods on ConcurrentLruCache
Closes gh-25963
2020-10-24 23:48:13 +02:00
Rossen Stoyanchev cf988f81b5 Merge branch '5.2.x' into master 2020-10-23 15:14:05 +01:00
Rossen Stoyanchev fb4363e4e0 Refactor DataBufferUtils Matcher implementation
The existing implementation was exposed to very poor performance when matching
with multiple delimiters against a large buffer with many delimiters. In that
case all matchers are invoked many times (as many as the number of delimiters)
even though some of them found no match at all on the first pass.

The revised implementation uses a single index and advances all matchers
together, checking one byte a time, and not letting any one of them search to
the end of the entire buffer on a single pass.

Closes gh-25915
2020-10-23 13:23:51 +01:00
Juergen Hoeller 1ec6843913 Upgrade CGLIB to ASM9 level as well
See gh-24872
2020-10-23 11:47:03 +02:00
Rossen Stoyanchev 784d72cc56 Fix checkstyle violations 2020-10-23 08:22:23 +01:00
Rossen Stoyanchev 9a1323aad5 Update StringDecoderBenchmark
See gh-25915
2020-10-22 21:50:27 +01:00
Rossen Stoyanchev eec6ec8f44 Merge branch '5.2.x' into master 2020-10-22 21:48:45 +01:00
Rossen Stoyanchev db9e0b0ccb Refactor StringDecoder
Simplify and optimize the processing of the input stream.

The existing implementation was using bufferUntil and creating a List
for every line along with an EndFrameBuffer inserted for the
bufferUntil predicate. So the larger the input buffer and the more
lines it contained, the greater the overhead.

The new implementation avoids bufferUntil for all lines and
instead uses concatMapIterable to aggregate the lines from a buffer
into a single list. So the larger the input buffer and the more
lines it contains, the better the throughput. The only buffering
used then is for partial chunks and those are accumulated in a list.

See gh-25915
2020-10-22 21:29:54 +01:00
Rossen Stoyanchev cfc3522641 Add jmh benchmark for StringDecoder
See gh-25915
2020-10-21 22:06:55 +01:00
Juergen Hoeller 621295dbd8 Deprecate StringUtils.isEmpty(Object) and replace remaining usage
Closes gh-25945
2020-10-21 16:09:26 +02:00
Juergen Hoeller 5ab1097b43 Consistent dependency declaration order 2020-10-16 15:19:25 +02:00
Juergen Hoeller f13c43bafe Consistent dependency declaration order 2020-10-16 12:22:04 +02:00
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