Commit Graph

1755 Commits

Author SHA1 Message Date
Juergen Hoeller 337d5874b1 Properties loading with ignoreResourceNotFound covers SocketException as well
Closes gh-25717

(cherry picked from commit 613b05d814)
2020-09-07 18:06:19 +02:00
Stephane Nicoll 81d5e66fe7 Make DataSize serializable
Closes gh-25676
2020-09-02 14:45:32 +02:00
Juergen Hoeller 2891dc6409 Polishing 2020-08-27 15:33:08 +02:00
Juergen Hoeller bfd20da9de Polishing (backported from 5.2.x) 2020-08-07 14:51:08 +02:00
Juergen Hoeller ce4001dd40 Refine use of substring operations
Closes gh-25445
2020-08-07 14:50:44 +02:00
Juergen Hoeller d9f9f8b0de Avoid unnecessary computation of cleaned URL
Closes gh-25531

(cherry picked from commit 96a4e1150e)
2020-08-07 14:50:29 +02:00
Juergen Hoeller a53d28edf1 Consistently use PropertySource.getName() for comparison
Includes synchronization for mutators on MutablePropertySources.

Closes gh-25369

(cherry picked from commit 01bab89dba)
2020-07-17 18:06:20 +02:00
Sam Brannen 14d539017c Make Profiles created via Profiles.of() comparable
Prior to this commit, a Profiles instance created via Profiles.of() was
not considered equivalent to another Profiles instance created via
Profiles.of() with the exact same expressions. This makes it difficult
to mock invocations of Environment#acceptsProfiles(Profiles) -- for
example, when using a mocking library such as Mockito.

This commit makes Profiles instances created via Profiles.of()
"comparable" by implementing equals() and hashCode() in ParsedProfiles.

Note, however, that equivalence is only guaranteed if the exact same
profile expression strings are supplied to Profiles.of(). In other
words, Profiles.of("A & B", "C | D") is equivalent to
Profiles.of("A & B", "C | D") and Profiles.of("C | D", "A & B"), but
Profiles.of("X & Y") is not equivalent to Profiles.of("X&Y") or
Profiles.of("Y & X").

Closes gh-25340
2020-07-07 14:41:08 +02:00
Juergen Hoeller 1b6afd52cb Document exception handling limitations in TaskDecorator implementations
Closes gh-25231
2020-06-10 22:57:21 +02:00
Juergen Hoeller 083dd0e19d Polishing 2020-05-29 16:31:11 +02:00
Juergen Hoeller e6553939b2 Consistent MultiValueMap behavior for empty list values
This commit extracts MultiValueMapAdapter from CollectionUtils and reuses its implementation as base class of LinkedMultiValueMap.

Closes gh-25140
2020-05-29 16:30:51 +02:00
Juergen Hoeller bb96bd4f48 Polishing 2020-05-26 23:55:56 +02:00
Sébastien Deleuze f023df703a Remove potentially confusing kotlin-reflect related log message
Closes gh-24939
2020-04-20 10:39:57 +02:00
Juergen Hoeller 3689b3fdd5 Recursively copy directory with symbolic link
Closes gh-24823
2020-04-03 21:46:07 +02:00
Juergen Hoeller 818d18aa09 Expose context class for interface-based CGLIB proxies as well
Closes gh-24657
2020-03-26 17:31:31 +01:00
Juergen Hoeller e51f660286 Polishing 2020-03-24 00:56:36 +01:00
Juergen Hoeller 51b8ba334a Polishing 2020-01-28 21:40:16 +01:00
Juergen Hoeller 1b50ca6bd3 Solve ReflectPermission issue in sandbox security policy model for CGLIB
Closes gh-24420
2020-01-28 21:19:15 +01:00
Rossen Stoyanchev 9969cb6d83 Improve limit handling in StringDecoder
The case of one data buffer containing multiple lines can could cause
a buffer leak due to a suspected issue in concatMapIterable. This
commit adds workarounds for that until the underlying issue is
addressed.

Closes gh-24346
2020-01-13 20:46:51 +00:00
Juergen Hoeller 7615e0b036 Un-deprecate PathResource (for NIO Path resolution in createRelative)
Includes aligned createRelative signature and dedicated java.io.File test.

Closes gh-24211
2019-12-16 17:05:28 +01:00
Juergen Hoeller afe22b84c2 ConcurrentReferenceHashMap cache for getInterfaceMethodIfPossible results
Closes gh-24206
2019-12-16 16:55:10 +01:00
Juergen Hoeller 3fbe762832 Consistent use of annotation-api dependency instead of tomcat-embed-core 2019-12-12 17:12:27 +01:00
Juergen Hoeller 611bb0b92e Explicit test dependency on javax.annotation.Priority 2019-12-12 17:01:18 +01:00
Juergen Hoeller a368040fd6 Polishing 2019-12-09 15:54:40 +01:00
Juergen Hoeller 197dbffe20 Support variable resolution of wildcard types
Includes cleanup of "varaible" typos in ResolvableTypeTests.

Closes gh-24150
2019-12-09 13:56:25 +01:00
Sam Brannen f049a6ec16 Add integration test for gh-24110 2019-12-03 17:12:14 +01:00
Sam Brannen 7fdf775394 Test status quo for @Inherited annotations in AnnotationMetadata
See gh-24077
2019-11-28 18:19:44 +01:00
Sam Brannen 59084c6b73 Test status quo for AnnotatedTypeMetadata.getAnnotationAttributes()
See gh-24077
2019-11-28 13:46:35 +01:00
Juergen Hoeller 262332a7c9 Upgrade to Jetty 9.4.23 and Woodstox 5.3 2019-11-21 13:48:55 +01:00
Juergen Hoeller 268d029584 Avoid substring allocation in StringUtils.replace
Closes gh-24023
2019-11-19 15:04:15 +01:00
Juergen Hoeller 85471d0587 Revise getElementTypeDescriptor javadoc (no IllegalStateException)
Closes gh-23996
2019-11-14 18:34:19 +01:00
Juergen Hoeller b4cf471021 Polishing 2019-10-30 16:45:35 +01:00
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