Commit Graph

1723 Commits

Author SHA1 Message Date
Rossen Stoyanchev
871464811c Limits on input stream in codecs
- Add maxInMemorySize property to Decoder and HttpMessageReader
  implementations that aggregate input to trigger
  DataBufferLimitException when reached.

- For codecs that call DataBufferUtils#join, there is now an overloaded
  variant with a maxInMemorySize extra argument. Internally, a custom
  LimitedDataBufferList is used to count and enforce the limit.

- Jackson2Tokenizer and XmlEventDecoder support those limits per
  streamed JSON object.

- Configurable limits for multipart requests with Synchronoss NIO.

- Centralized maxInMemorySize exposed via CodecConfigurer along with
  ability to plug in an instance of MultipartHttpMessageWrite.

Closes gh-23884
2019-10-29 12:36:36 +00:00
Juergen Hoeller
bb6f9bb6d4 Polishing 2019-09-25 12:14:48 +02:00
Stephane Nicoll
b65984a078 Consume getProtocolResolvers() rather than internal list
This commit makes sure that DefaultResourceLoader consistently use
getProtocolResolvers() to access additional protocol resolvers. This
allows subclasses to define how the list is provided.

Closes gh-23564
2019-09-16 14:35:00 +02:00
Phillip Webb
d945ae9191 Add blank line between java and javax imports
See gh-23539

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2019-09-16 13:41:59 +02:00
Sam Brannen
d09f537699 Annotate Object#equals parameter with @nullable
See gh-23093

Co-authored-by: Sebastien Deleuze <sdeleuze@pivotal.io>
2019-09-16 12:43:13 +02:00
Juergen Hoeller
c8f20815ef Revise LinkedCaseInsensitiveMap's lazy key/value/entry collections
Closes gh-22926
2019-09-16 12:38:46 +02:00
Juergen Hoeller
60976e4116 Add missing nullable declarations
See gh-22821
2019-09-16 12:37:49 +02:00
Phillip Webb
aa69703f3b Fix LinkedCaseInsensitiveMap collection methods
Ensure that results returned from keySet, entrySet & values are tracked
to remove case insensitive keys from the source map.

Closes gh-22821
2019-09-16 12:36:05 +02:00
Sam Brannen
961010055e Support trailing comment in DTD declaration in XML config
Prior to this commit, Spring failed to determine that an XML config file
was DTD-based if the DTD declaration was followed by a comment.

This commit fixes this by modifying the consumeCommentTokens(String)
algorithm in XmlValidationModeDetector so that both leading and trailing
comments are properly consumed without losing any XML content.

Closes gh-23605
2019-09-09 16:18:21 +02:00
Sam Brannen
f37ec90f2f Consider Void.class a primitive wrapper in ClassUtils
Prior to this commit, ClassUtils.isPrimitiveOrWrapper() and
ClassUtils.isPrimitiveWrapper() did not return true for Void.class.
However, ClassUtils.isPrimitiveOrWrapper() did return true for
void.class. This lacking symmetry is inconsistent and can lead to bugs
in reflective code.

See: https://github.com/spring-projects/spring-data-r2dbc/issues/159

This commit addresses this by adding an entry for Void.class -> void.class
in the internal primitiveWrapperTypeMap in ClassUtils.

Closes gh-23572
2019-09-03 14:02:24 +02:00
Arjen Poutsma
f748b1e68d Fix timing bug in DataBufferUtils::readAsynchronousFileChannel
This commit makes sure that reading is enabled after the current
signal has been processed, not while is is being processed. The bug
was only apparent while using the JettyClientHttpConnector, which
requests new elements continuously, even after the end of the
stream has been signalled.
2019-09-02 15:13:22 +02:00
Arjen Poutsma
2c5958e191 Support back pressure in DataBufferUtils::readAsynchronousFileChannel
This commit adds support for back pressure in the ReadCompletionHandler,
as used by DataBufferUtils::readAsynchronousFileChannel.

See gh-23518
2019-08-29 16:34:36 +02:00
Sam Brannen
30ebc3b8e2 Remove superfluous AnnotationAttributes#putIfAbsent implementation
Since Java 8, putIfAbsent() is a standard method in java.util.Map. We
therefore no longer need the custom implementation that overrides the
standard implementation in HashMap.
2019-08-06 18:10:13 +02:00
Sam Brannen
a092dc055e Check for instanceof Throwable in AnnotationAttributes#assertNotException
Prior to this commit, AnnotationAttributes#assertNotException checked if
the attribute value was an instance of Exception. Although this was
typically sufficient, the scope was not always broad enough -- for
example, if AnnotationReadingVisitorUtils#convertClassValues stored a
Throwable in the map (such as a LinkageError).

This commit fixes this by checking for an instance of Throwable in
AnnotationAttributes#assertNotException.

Closes gh-23424
2019-08-06 18:06:00 +02:00
Juergen Hoeller
aebc485eda MethodParameter.equals properly checks overridden containing class
Closes gh-23352
2019-08-01 14:34:39 +02:00
Juergen Hoeller
9a36027ae1 MethodParameter.equals checks nesting level and containing class
Closes gh-23352
2019-07-30 16:58:45 +02:00
Juergen Hoeller
209c8505e6 Align forRawClassAssignableFromTypeVariable with 5.1 assertion style
See gh-23321
2019-07-20 16:10:49 +02: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
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
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
Juergen Hoeller
fc46abf0b7 Polishing 2019-06-12 18:04:06 +02:00
Juergen Hoeller
1ccd99ebe7 Polishing 2019-06-12 14:11:39 +02:00
Juergen Hoeller
33b5bc2aae Polishing 2019-06-11 23:50:29 +02:00
Juergen Hoeller
7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00
Juergen Hoeller
4fc9747569 Defensive concurrent access to key set from java.util.Properties
Closes gh-23063
2019-06-11 20:56:57 +02:00
Juergen Hoeller
b37390b8fe Restore javax meta-annotation lookup behavior
Closes gh-22957
2019-06-11 20:56:41 +02:00
Rossen Stoyanchev
99302fd6bd AntPathMatcher#isPattern also checks URI vars
Closes gh-22959
2019-05-23 09:56:11 -04:00
Juergen Hoeller
701b7b8a18 Align ReactiveTypeDescriptor accessor methods 2019-05-21 20:46:27 +02:00
Juergen Hoeller
55e601c322 Revise system property replacement tests
See gh-22959
2019-05-20 22:19:03 +02:00
Juergen Hoeller
46e5dd6420 Consistent handling of empty List entries in LinkedMultiValueMap
Closes gh-22912
2019-05-07 13:08:42 +02:00
Juergen Hoeller
293188c797 Consistent non-use of firstIndex 0 in PatternMatchUtils
Closes gh-22837
2019-05-04 12:01:54 +02:00
Juergen Hoeller
9674ce4906 Avoid HashSet/StringBuilder allocation for non-placeholder values
Closes gh-22870
2019-05-04 12:00:22 +02:00
Juergen Hoeller
a7949ac84a Consistent use of StringUtils.hasLength(String) vs isEmpty(Object) 2019-05-03 17:29:14 +02:00
Juergen Hoeller
5b1b1bae37 Consistent use of try-with-resources for local resource closing 2019-05-03 00:11:47 +02:00
Juergen Hoeller
31c3b8a291 Avoid unguarded String concatenation for debug/trace logging
Closes gh-22874
2019-05-03 00:10:56 +02:00
Juergen Hoeller
a8f845c944 Upgrade to Checkstyle 8.20 and CGLIB 3.2.11
Includes dependency management plugin 1.0.7.
2019-04-30 18:44:08 +02:00
Juergen Hoeller
1f473261a8 Polishing 2019-04-26 22:56:23 +02:00
Juergen Hoeller
e5e2d2d661 Polishing (includes minor performance refinements from master) 2019-04-26 16:51:18 +02:00
Juergen Hoeller
bdd9a557a5 Streamline ReactiveAdapterRegistry.getAdapter usage
Closes gh-22842
2019-04-26 16:49:16 +02:00
Sam Brannen
52b6f9b56d Align Javadoc for Base64Utils.encodeToString() with implementation
Closes gh-22812
2019-04-17 12:33:22 -04:00
Rossen Stoyanchev
375090bb7c LeakAwareDataBuffer related fixes
Following on 3ebbfa2191 where the local
refCount was removed in favor of using the internal refCount of the
native data buffer, this commit ensures that LeakAwareDataBufferFactory
uses a PooledDataBufferFactory delegate by default.

There are also fixes for test issues with eager allocation uncovered by
these changes in StringDecoder and ResourceDecoder.
2019-04-16 20:52:19 -04:00
Rossen Stoyanchev
bd2c213b47 Remove buffer release used as workaround
The extra buffer release was used as a workaround for a reactor core
issue and should have already been removed as part of
b3bc2d9253.
2019-04-10 15:36:36 -04:00
Rossen Stoyanchev
3ebbfa2191 Fix refCount issue in LeakAwareDataBuffer
LeakAwareDataBuffer was keeping its own refCount rather than checking
through the delegate. This leads to false leak reports in a sequence
where an allocated buffer is retained and then sliced since it is not
aware of the changes to the refCount through the slice.
2019-04-10 15:33:19 -04:00
Rossen Stoyanchev
b11e7feff6 Polish during review of DataBuffer handling 2019-04-09 22:19:05 -04:00
Juergen Hoeller
4ec9aff01d Polishing 2019-04-08 19:59:06 +02:00
Juergen Hoeller
43cb1af26a Polishing 2019-04-08 15:33:26 +02:00
Rossen Stoyanchev
b3bc2d9253 Remove workaround for reactor-core issue 2019-04-03 16:27:02 -04:00
Juergen Hoeller
0cc6a9ef11 Avoid getDeclaredMethod check in ReflectionUtils.isObjectMethod
Closes gh-22730
2019-04-03 18:21:26 +02:00
Juergen Hoeller
0babc1fb64 Polishing 2019-04-02 20:04:07 +02:00
Rossen Stoyanchev
85332c7a49 Polish 2019-03-29 15:53:45 -04:00