Commit Graph

575 Commits

Author SHA1 Message Date
Juergen Hoeller
ef3f93e84a Language tag parsing support in StringUtils and StringToLocaleConverter
Issue: SPR-16188
2018-01-25 19:10:31 +01:00
Arjen Poutsma
0befc60c8f Renamed DataBufferUtils/DataBufferFactory.compose to join
Issue: SPR-16365
2018-01-22 10:51:07 +01:00
sdeleuze
3f3141cdda Add additional test for SPR-16210
Issue: SPR-16210
2018-01-22 10:29:21 +01:00
Juergen Hoeller
572c668726 Polishing 2018-01-19 21:30:37 +01:00
Arjen Poutsma
5520e730f1 DataBufferUtils.read should not take input stream/channel as parameter
Fixed by creating `Callable`-based variants, as explained in the JIRA
issue.

Issue: SPR-16403
2018-01-19 17:38:14 +01:00
Juergen Hoeller
4c7414833b ResolvableType returns clone for cached state with original local source
Issue: SPR-16210
2018-01-19 12:30:03 +01:00
Juergen Hoeller
4c9ed0d87e Polishing 2018-01-12 18:24:00 +01:00
Juergen Hoeller
347c2daa2c Test for multiple interfaces at BridgeMethodResolver level
Issue: SPR-16288
2018-01-12 16:45:38 +01:00
Arjen Poutsma
67e7c784e8 Use DataBufferUtils.compose and remove writeAggregator
Use DataBufferUtils.compose instead of writeAggregator to combine
multiple data buffers into one, as the write aggregator would not work
when the initial data buffer did not have enough capacity to contain
all subsequent buffers.

Removed writeAggregator, as it is no longer needed.

Issue: SPR-16365
2018-01-12 10:36:09 +01:00
Arjen Poutsma
384a399fd2 Add DataBufferUtils.compose
Added a utility method that composes data buffers into a single buffer.
Depending on the `DataBuffer` implementation, the returned buffer may be
a single buffer containing all data of the provided buffers, or it may
be a true composite that contains references to the buffers.

Issue: SPR-16365
2018-01-12 10:36:09 +01:00
Arjen Poutsma
69ccba30e9 Introduce write aggregator to DataBufferUtils
As a consequence of dropping CompositeByteBuf (see prior commit),
DataBuffers fluxes that are aggregated with Flux.reduce(BiFunction) are
now required to be released, as the composite no longer holds a
reference to subsequent data buffers.

For this purpose, DataBufferUtils now has a writeAggregator that can be
used with Flux.reduce, and that released the subsequent buffers
properly.

Issue: SPR-16351
2018-01-10 11:14:02 +01:00
Arjen Poutsma
e6893da971 Remove use of CompositeByteBuf in NettyDataBuffer
Prior to this commit, NettyDataBuffer had a optimization in
write(ByteBuf...), where it used a CompositeByteBuf to hold the original
and the parameter buffer.
Unfortunately, this procedure has nasty consequences when splicing
buffers (see https://stackoverflow.com/a/48111196/839733).

As of this commit, NettyDataBuffer stopped using CompositeByteBuf, and
 simply does ByteBuf.write().

Issue: SPR-16351
2018-01-10 11:05:41 +01:00
Juergen Hoeller
1a154c3e4c Consistently throw FileNotFoundException even for NIO access
Issue: SPR-16334
2018-01-07 23:18:28 +01:00
Rossen Stoyanchev
f4d8c7cc2b Improve decodeToMono support
This commit ensures uniform support for decodeToMono across the various
byte and String related decoders.

Issue: SPR-16253
2017-12-14 16:59:34 -05:00
Sam Brannen
767ea9db83 Fix minor logic error in SocketUtils 2017-12-06 17:00:29 -08:00
Tony Mitchell
9f36d170be Support identical minPort and maxPort in SocketUtils (#1612)
This commit fixes a bug where an IllegalStateException was
thrown if the minPort and maxPort values supplied to
SocketUtils.findAvailableTcpPort(int, int) were identical.
2017-12-06 16:38:46 -08:00
sdeleuze
9f1d8517ba Polish Kotlin source code style 2017-11-21 15:59:23 +01:00
Rossen Stoyanchev
bc8e525e60 Add shared instance of ReactiveAdapterRegistry
Issue: SPR-16218
2017-11-20 17:02:22 -05:00
diesieben07
0e49e32188 Handle parameters of Kotlin extension methods correctly
The EXTENSION_RECEIVER parameter of Kotlin's extension
methods appear as normal method parameters to Java and
thus require a name. The synthetic name "$receiver" is
used here, as it is not a valid Kotlin identifier,
but valid in Java.

Issue: SPR-16119
2017-11-13 15:42:32 +01:00
Juergen Hoeller
996d747aed Upgrade to Mockito 2.11
Includes fixes for invalid exception declarations in Mockito-based unit tests. Also includes FreeMarker 2.3.27, Commons Pool 2.4.3, JSON-P 1.1.2.

Issue: SPR-16157
2017-11-04 01:06:59 +01:00
Juergen Hoeller
d00e4f17ec ClassPathResource uses specific constructors in createRelative
Issue: SPR-16146
2017-11-02 16:05:57 +01:00
Juergen Hoeller
182da15908 BridgeMethodResolver properly resolves interface hierarchies
Issue: SPR-16103
2017-10-24 01:01:49 +02:00
Juergen Hoeller
75ec973bae Refined tests for StringUtils.starts/endsWithIgnoreCase
Issue: SPR-16095
2017-10-22 20:29:46 +02:00
Juergen Hoeller
5d41e0f012 Avoid temporary String creation in StringUtils.starts/endsWithIgnoreCase
Issue: SPR-16095
2017-10-22 14:31:17 +02:00
Juergen Hoeller
9a88ebdeba Consistent hasText checks for CharSequence vs String
Issue: SPR-15540
2017-10-22 12:12:32 +02:00
Arjen Poutsma
c7a15260d6 Various DataBuffer improvements
This commit introduces various improvements in DataBuffer:

- DataBuffer now exposes its read and write position, as well as its
capacity and writable byte count.
- Added DataBuffer.asByteBuffer(int, int)
- DataBufferUtils.read now reads directly into a DataBuffer, rather than
copying a ByteBuffer into a DataBuffer
- TomcatHttpHandler now reads directly into a DataBuffer

Issues: SPR-16068 SPR-16070
2017-10-19 10:38:52 +02:00
Juergen Hoeller
c29b6f5b55 Consistent handling of null array for arguments
Issue: SPR-16075
2017-10-16 15:34:18 +02:00
Sam Brannen
8a94077da0 Clean up warnings in spring-core 2017-10-15 18:28:08 +02:00
Juergen Hoeller
43b5e21947 Consistent alias declarations for value attribute on stereotypes
Issue: SPR-16066
2017-10-13 18:18:12 +02:00
Juergen Hoeller
53091c76bf Convenient forType methods for ParameterizedTypeReference
Issue: SPR-16054
2017-10-09 13:59:01 +02:00
Sebastien Deleuze
5ae35f606c Leverage kotlin-reflect to determine parameter names
This is especially useful to determine interface parameter names
without requiring Java 8 -parameters compiler flag.

Issue: SPR-15541
2017-09-06 15:56:45 +02:00
Juergen Hoeller
204ddebd68 SimpleAsyncTaskExecutor properly respects NO_CONCURRENCY
Issue: SPR-15895
2017-09-01 13:44:49 +02:00
Juergen Hoeller
26de6268aa Polishing 2017-07-27 16:06:56 +02:00
Juergen Hoeller
c5fc400534 (AnnotationAware)OrderComparator supports null values again
Issue: SPR-15823
2017-07-27 11:39:05 +02:00
Arjen Poutsma
d5da823482 Fix race condition for AsynchronousFileChannel
This commit fixes an issue in the DataBufferUtils.write variant that
takes a AsynchronousFileChannel.

Issue: SPR-15798
2017-07-26 14:10:48 +02:00
Rossen Stoyanchev
d7a7b08b08 Find the last plus for suffix MediaType
Issue: SPR-15795
2017-07-25 10:45:59 +02:00
Sebastien Deleuze
2437500cfe Ignore DataBufferUtilsTests#writeAsynchronousFileChannel
Issue: SPR-15798
2017-07-20 13:51:13 +02:00
Sebastien Deleuze
e2fd04dff3 Add a [] Kotlin extension for PropertyResolver#getRequiredProperty 2017-07-19 08:12:32 +02:00
Juergen Hoeller
12114a9d4c Consistent use of NIO.2 for file read/write interactions
Issue: SPR-15748
2017-07-18 00:54:41 +02:00
Rossen Stoyanchev
d56fedc226 Methods for reading a Resource in DataBufferUtils
Currently ResourceEncoder and ResourceRegionEncoder use DataBufferUtils
to read resource with an AsynchronousFileChannel if it is a file or
otherwise fallback on getting the channel from the resource.

The same is now required in other places where a Resource needs to be
read and is also generally useful.

Issue: SPR-15773
2017-07-17 12:25:25 +02:00
Rossen Stoyanchev
d3749bc1ec Add timeout to DataBufferUtilsTests to avoid hanging 2017-07-14 23:07:48 +02:00
Arjen Poutsma
c802827f0f Change write methods to return Flux<DataBuffer>
This commit changes the write methods to return `Flux<DataBuffer>`
instead of `Mono<Void>`, giving access to the original buffers,
so that they can decided whether the buffers need to be closed or not.

Issue: SPR-15726
2017-07-14 18:55:25 +02:00
Arjen Poutsma
83051b06b8 Add write methods to DataBufferUtils
This commit adds an overloaded write method to `DataBufferUtils`. There
are three parameter variants: `OutputStream`, `WritableByteChannel`, and
`AsynchronousFileChannel`.

Issue: SPR-15726
2017-07-14 17:13:59 +02:00
Juergen Hoeller
3714e7b044 Deprecate FileSystemUtils
Issue: SPR-15748
2017-07-10 14:25:13 +02:00
Juergen Hoeller
9b5132ce53 LinkedCaseInsensitiveMap exposes its locale for key conversion
Issue: SPR-15752
2017-07-10 14:24:28 +02:00
Arjen Poutsma
621df7c978 Add ByteBuf leak detection @Rule
This commit introduces a JUnit rule that detects ByteBuf leaks in
subclasses of AbstractDataBufferAllocatingTestCase.
2017-06-30 10:52:00 +02:00
Juergen Hoeller
87430f3cd3 ListenableFuture provides CompletableFuture adaptation via completable()
Issue: SPR-15696
2017-06-27 00:43:37 +02:00
Stephane Nicoll
58242f2249 Polish 2017-06-13 10:13:14 +02:00
Stephane Nicoll
27aabb15f9 Polish "Refact iterator of Map with Java 8 forEach"
Closes gh-1451
2017-06-12 08:53:56 +02:00
diguage
dab7a7f0ee Refact iterator of Map with Java 8 forEach
See gh-1451
2017-06-12 08:11:32 +02:00