Commit Graph

1932 Commits

Author SHA1 Message Date
Juergen Hoeller
4612544505 Nullability refinements and related polishing 2019-08-01 13:04:46 +02:00
Phillip Webb
1e830f725c Polish firstRunOf javadoc 2019-08-01 08:29:02 +01:00
Phillip Webb
62a3e41473 Deprecate mutable methods of MethodParameter
Deprecate all mutation methods in `MethodParameter` in favor of factory
methods that return a new instance. Existing code that previously relied
on mutation has been updated to use the replacement methods.

Closes gh-23385
2019-08-01 08:05:14 +01:00
Sam Brannen
de3c115614 Fix bug in TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy
Prior to this commit, the new `TYPE_HIERARCHY_AND_ENCLOSING_CLASSES`
annotation search strategy failed to find annotations on enclosing
classes if the source class was a nested class that itself had no
annotations present.

This commit fixes this by adding special logic to AnnotationsScanner's
isWithoutHierarchy() method to properly support nested classes.

Closes gh-23378
2019-07-31 22:05:46 +02:00
Sam Brannen
b03dd47598 Remove duplicate assertion 2019-07-31 22:01:18 +02:00
Phillip Webb
17518ecbbe Add TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy
Add a `TYPE_HIERARCHY_AND_ENCLOSING_CLASSES` annotation search strategy
that can be used to search the full type hierarchy as well as any
enclosing classes.

Closes gh-23378
2019-07-31 14:40:40 +01:00
Phillip Webb
a6021cc968 Rename SearchStrategy.EXHAUSTIVE to TYPE_HIERARCHY
Rename `SearchStrategy.EXHAUSTIVE` from `MergedAnnotations` to
`SearchStrategy.TYPE_HIERARCHY`

See gh-23378
2019-07-31 13:52:53 +01:00
Juergen Hoeller
e6f86c5c75 Nullability refinements and related polishing 2019-07-31 13:45:48 +02:00
Phillip Webb
cca32a56a4 Use shared zero length array constants
Update code that's often called so that zero length array results use
a single shared static constant, rather than a new instance for each
call.

Closes gh-23340
2019-07-31 12:22:03 +02:00
Juergen Hoeller
4f3b89e907 Adapt MethodParameterTests to AssertJ usage on master
See gh-23352
2019-07-30 17:36:02 +02:00
Juergen Hoeller
8ef557df2f Merge branch '5.1.x' 2019-07-30 17:34:29 +02:00
Juergen Hoeller
9a36027ae1 MethodParameter.equals checks nesting level and containing class
Closes gh-23352
2019-07-30 16:58:45 +02:00
Johnny Lim
bccc7a62f4 Remove duplicate assertion in matchWithNullPath()
See gh-23382
2019-07-30 09:37:50 +02:00
Sam Brannen
a3c7ae2c58 Polish contribution
See gh-23300
2019-07-24 10:13:29 +02:00
stsypanov
1d6e44ab04 Use StringJoiner where possible to simplify String joining
Closes gh-23300
2019-07-24 10:05:38 +02:00
Sebastien Deleuze
c006a83584 Upgrade to Coroutines 1.3.0-RC
This commit upgrades Coroutines support to kotlinx.coroutines
1.3.0-RC, leverages the new Coroutines BOM and refine Coroutines
detection to avoid false positives.

Only Coroutines to Mono context interoperability is supported
for now.

CLoses gh-23326
2019-07-21 11:27:43 +02:00
Juergen Hoeller
8ea3aa512f Merge branch '5.1.x' 2019-07-20 16:35:05 +02:00
Juergen Hoeller
209c8505e6 Align forRawClassAssignableFromTypeVariable with 5.1 assertion style
See gh-23321
2019-07-20 16:10:49 +02:00
Juergen Hoeller
69d3e89814 Polishing 2019-07-20 15:05:49 +02:00
Phillip Webb
be65bef91b Merge branch '5.1.x' 2019-07-20 13:23:37 +01:00
Phillip Webb
e5bef10d85 Fix ResolvableType raw class isAssignable checks
Fix `isAssignable` for `ResolvableType.forRawClass` so that it can be
used with types backed by a `TypeVarible`. Prior to this commit the
rawClass value was used, which wouldn't always work.

Closes gh-23321
2019-07-20 13:23:21 +01:00
Arjen Poutsma
090bfa63a1 Add DataBuffer::toString(Charset)
Closes gh-23317
2019-07-19 12:45:24 +02:00
Arjen Poutsma
c8704ce473 Introduce DataBufferWrapper
This commit introduces the DataBufferWrapper, a wrapper for DataBuffers,
and uses it in applicable use cases.
2019-07-19 12:45:24 +02:00
Juergen Hoeller
7f33344784 Tracking ASM master
See gh-23156
2019-07-17 22:34:39 +02:00
Juergen Hoeller
94e3210ae7 Fix nullability warnings and javadoc-triggered package cycles 2019-07-17 22:34:07 +02:00
Sam Brannen
7779aa3487 Polish contribution
See gh-23297
2019-07-17 16:53:47 +02:00
Scheidter,Ryan
84200f3141 Treat null path as non-matching pattern in AntPathMatcher
Prior to this commit, a null path supplied to the isPattern(), match(),
and matchStart() methods in AntPathMatcher resulted in a
NullPointerException.

This commit addresses this by treating a `null` path as a non-matching
pattern.

Closes gh-23297
2019-07-17 16:53:47 +02:00
Sam Brannen
699d3f15e8 Simplify LocalVariableTableParameterNameDiscoverer implementation
This commit refactors the internals of
LocalVariableTableParameterNameDiscoverer to use
java.lang.reflect.Executable in order to simplify the implementation.
2019-07-12 12:02:49 +02:00
mfeng-ya
309b328719 Use computeIfAbsent in LocalVariableTableParameterNameDiscoverer
Closes gh-23281
2019-07-12 11:44:10 +02:00
Arjen Poutsma
09572e7b60 Removed DataBufferUtils::split
DataBuffers::split (and underlying algorithm) should not be returning
a Flux<DataBuffer>, but rather a Flux<Flux<DataBuffer>>. In other words,
it should not join all data buffers that come before a delimiter.

Providing an implementation of a such a fully reactive split method
proved to be beyond the scope of this release, so this commit removes
the method altogether.
2019-07-10 16:00:11 +02:00
Arjen Poutsma
fdcf09dc2f Copied buffering split from DataBufferUtils to StringDecoder
Due to the imminent removal of DataBufferUtils.split, this commit copies
over the buffering split algortihm from DataBufferUtils, as it is still
sutable for the StringDecoder
2019-07-10 16:00:11 +02:00
Arjen Poutsma
ef19a6bf8e Various DataBufferUtils improvements
- Made sure that takeUntilByteCount is usable in multiple subscriptions.
- Added composite Matcher
2019-07-10 16:00:11 +02:00
Sebastien Deleuze
ca75c2843a Upgrade to Coroutines 1.3.0-M2 2019-07-09 11:36:26 +02:00
Rossen Stoyanchev
c199cb9054 @ConnectMapping for RSocket handling
The new annotation helps to differentiate the handling of connection
level frames (SETUP and METADATA_PUSH) from the 4 stream requests.

Closes gh-23177
2019-07-08 17:04:23 +01:00
Sam Brannen
fae75cb238 Polish contribution
See gh-23237
2019-07-07 16:29:03 +02:00
Сергей Цыпанов
9f81ffa5ae Use StringJoiner where possible to simplify String joining
Closes gh-23237
2019-07-07 16:19:01 +02:00
Sam Brannen
8f5b2b2231 Merge branch '5.1.x' 2019-07-07 14:49:34 +02:00
Sam Brannen
efab6eb55d Ignore empty entries when parsing MediaTypes and MimeTypes
Prior to Spring Framework 5.1.3, MimeTypeUtils.parseMimeTypes() and
MediaType.parseMediaTypes() ignored empty entries, but 5.1.3 introduced
a regression in that an empty entry -- for example, due to a trailing
comma in the list of media types in an HTTP Accept header -- would result
in a "406 Not Acceptable" response status.

This commit fixes this by filtering out empty entries before parsing
them into MimeType and MediaType instances. Empty entries are therefore
effectively ignored.

Fixes gh-23241
2019-07-07 12:39:46 +02:00
Juergen Hoeller
d903b9acf5 Compatibility with RxJava 3.0
Closes gh-23208
2019-07-05 16:25:52 +02:00
Juergen Hoeller
6990504d17 Upgrade to ASM 7.2
Closes gh-23156
2019-07-05 16:24:45 +02:00
Rossen Stoyanchev
0d3e5db3ff Compare suffix patterns by length
Closes gh-23125
2019-07-05 07:36:35 +01:00
Phillip Webb
b3d56ebf3b Restore StringUtils.hasLength check
Update `MimeTypeUtils` so that the  StringUtils.hasLength check is
performed immediately on the incoming argument, rather than in
`parseMimeTypeInternal`. This restores the `IllegalArgumentException`
rather than the `NullPointerException` which is thrown by the
`ConcurrentHashMap`.

Closes gh-23215
See gh-23211
2019-06-29 22:31:11 -07:00
Brian Clozel
5a308ad5bd Polish MimeTypeUtils LRU cache
This commit improves the cache implementation by skipping the ordering
of most recently used cached keys when the cache is at least half empty.

See gh-23211
2019-06-29 00:17:40 +02:00
Brian Clozel
1b93ea97ac Fix concurrent reads issue in MimeTypeUtils cache
As of gh-22340, `MimeTypeUtils` has a built-in LRU cache implementation
for caching parsed MIME types and avoiding excessive garbage creation at
runtime.
This implementation, when hit with highly concurrent reads on the same
media type (the cache key), can create multiple keys for the same MIME
type string. This duplication leads to the cache filling up and evicting
entries. When the cache fetches a duplicate key, it is then not
associated with a value and the cache can return a `null` value, which
is forbidden by the API contract.

This commit adds another cache check within the write lock: this avoids
creating duplicate entries in the cache and `null` return values.

Fixes gh-23211
2019-06-28 23:43:38 +02:00
Sam Brannen
33fa55e658 Update OrderComparatorTests based on clarified PriorityOrdered semantics
See gh-23187
2019-06-25 11:04:19 +03:00
Sam Brannen
b2dc4debde Merge branch '5.1.x' 2019-06-25 10:42:14 +03:00
Sam Brannen
dda4dfb44b Clarify semantics of the PriorityOrdered interface
This commit clarifies the semantics of the PriorityOrdered interface
with respect to sorting sets of objects containing both PriorityOrdered
and plain Ordered objects.

Closes gh-23187
2019-06-25 10:40:55 +03:00
Johnny Lim
1afc2be5aa Remove duplicate assertion in AnnotatedElementUtilsTests
Closes gh-23191
2019-06-25 10:00:12 +03:00
Sam Brannen
6cc6abd405 Test status quo for OrderComparator's PriorityOrdered support
See gh-23187
2019-06-24 14:13:46 +03:00
Sam Brannen
4357749a63 Document that OrderComparator honors PriorityOrdered
Prior to this commit, it was not clear that OrderComparator sorts
PriorityOrdered objects with higher priority than plain Ordered objects.
2019-06-24 13:32:54 +03:00