Commit Graph

1402 Commits

Author SHA1 Message Date
igor-suhorukov e381514b07 Collection.isEmpty() should be used to test for emptiness
Closes gh-1670
2018-02-09 10:11:44 +01:00
igor-suhorukov 4c888d0f32 Polish
Closes gh-1669
2018-02-09 10:10:05 +01:00
Arjen Poutsma fb61af1882 Allow "release on close" for DataBuffer.asInputStream
This commit introduces DataBuffer.asInputStream(boolean), that can
release the underlying buffer when the stream is closed.

Furthermore, this commit adds additional javadoc.

Issue: SPR-16444
2018-02-08 10:11:53 +01:00
Arjen Poutsma 609f173ebc StringDecoder shouldn't chop off strings randomly
Issue: SPR-16337
2018-02-02 15:59:21 +01:00
Juergen Hoeller cfe7ff1c81 MimeType.compareTo uses case-insensitive Charset (analogous to equals)
Issue: SPR-16458
2018-02-02 13:44:07 +01:00
Juergen Hoeller c5a33d62dd TypeVariablesVariableResolver compares variables by full equality again
Issue: SPR-16456
2018-02-02 12:41:43 +01:00
Juergen Hoeller 30f6e447d5 TypeVariablesVariableResolver compares variables by name
Issue: SPR-16456
2018-02-02 11:34:36 +01:00
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 b2ce98e881 Upgrade to CGLIB 3.2.6
Issue: SPR-16267
2018-01-20 14:29:56 +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 ea5f8f5a7c Consistently handle NoClassDefFoundError in BeanUtils and related places
Issue: SPR-16369
2018-01-17 20:24:57 +01:00
Juergen Hoeller 4c9ed0d87e Polishing 2018-01-12 18:24:00 +01:00
Juergen Hoeller 06e6386dc9 CollectionUtils.lastElement for common Set/List extraction
Issue: SPR-16374
2018-01-12 18:23:52 +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
Juergen Hoeller 121f9e3734 BridgeMethodResolver properly resolves all declared interfaces
Issue: SPR-16288
2018-01-11 10:18:27 +01:00
Arjen Poutsma 5adaa1030c Javadoc 2018-01-10 17:54:51 +01:00
Arjen Poutsma 8a129ef3da Use write aggregator from DataBufferUtils
This commit uses the newly introduced write aggregator from
DataBufferUtils throughout WebFlux.

Issue: SPR-16351
2018-01-10 11:15:47 +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 45828cb934 Check BeanInfoFactory for interface introspection as well
Issue: SPR-16322
2018-01-08 18:05:02 +01:00
Juergen Hoeller 7ad69bfc20 Avoid extra existence check in SimpleMetadataReaderFactory
Issue: SPR-16281
2018-01-07 23:18:52 +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
Christoph Dreis 260ebeca3a Improve performance of some string operations
Issue: SPR-16293
2017-12-12 17:14:24 +01: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
Sam Brannen f9689dfe48 Polishing 2017-12-06 15:54:02 -08:00
Sam Brannen 773cd3241b Polishing 2017-11-28 14:11:21 +01:00
Juergen Hoeller 0cc644f61f Polishing 2017-11-21 16:34:08 +01:00
sdeleuze 9f1d8517ba Polish Kotlin source code style 2017-11-21 15:59:23 +01:00
Juergen Hoeller 5843173567 Polishing 2017-11-21 13:42:57 +01:00
jianglei 4b614dc1de Fix copy/paste in Javadoc
Closes gh-1601
2017-11-21 06:58:14 +01:00
Rossen Stoyanchev bc8e525e60 Add shared instance of ReactiveAdapterRegistry
Issue: SPR-16218
2017-11-20 17:02:22 -05:00
Juergen Hoeller 84699c8b9b Document common use cases for @Order vs @Priority vs @DependsOn
Issue: SPR-16213
2017-11-20 12:53:37 +01:00
Arjen Poutsma e4d405271a Document DataBuffer/PooledDataBuffer and codecs
Issue: SPR-16156
2017-11-16 11:36:26 +01: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
Sam Brannen 2be2aa7b96 Add missing word to JavaDoc 2017-11-13 00:46:20 +01:00
Arjen Poutsma 8223809455 Use existing CompositeByteBuf if possible
This commit uses the existing CompositeByteBuf if present, as opposed
to creating a new composite for every call to
NettyDataBuffer.write(ByteBuf...)

Issue: SPR-16180
2017-11-10 15:09:14 +01:00
Juergen Hoeller 9b7af8b5aa Polishing 2017-11-05 21:07:26 +01:00
Juergen Hoeller 07b479e264 FileUrlResource creates same class from createRelative
Issue: SPR-16140
2017-11-05 21:01:29 +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 b921d564d2 DefaultResourceLoader resolves writable FileUrlResource for "file:" URL
Issue: SPR-16140
2017-11-02 16:05:40 +01:00
Juergen Hoeller a2f5e1254e Drive letter case alignment in addClassPathManifestEntries
Issue: SPR-16117
2017-10-26 15:28:27 +02:00
Juergen Hoeller 7e8c8f0b76 Polishing 2017-10-25 19:23:48 +02:00
Juergen Hoeller 2d0ab4740c Consistent hasText checks for CharSequence vs String
Directly inlined hasLength implementations for proper nullability detection in IntelliJ, assuming a hasText checked value is never null afterwards. Since the JVM is going to do this at runtime anyway, this is effectively equivalent but more indicative for source code introspection algorithms.

Issue: SPR-15540
2017-10-24 13:16:47 +02:00
Juergen Hoeller 182da15908 BridgeMethodResolver properly resolves interface hierarchies
Issue: SPR-16103
2017-10-24 01:01:49 +02:00
Juergen Hoeller 55b0c2f243 Polishing 2017-10-24 01:01:42 +02:00
Juergen Hoeller ecea82d3a5 Polishing 2017-10-23 17:14:09 +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 3d1023be8c Polishing 2017-10-17 11:56:30 +02:00
Rossen Stoyanchev b4c95bf278 ReactiveAdapterRegistry uses Reactor's JdkFlowAdapter
Issue: SPR-16052
2017-10-16 20:49:22 -04: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 dc3299152c Polishing 2017-10-09 16:06:03 +02:00
Juergen Hoeller 53091c76bf Convenient forType methods for ParameterizedTypeReference
Issue: SPR-16054
2017-10-09 13:59:01 +02:00
Juergen Hoeller ec345bf162 Revised handling of missing data class arguments
Includes unified detection of Kotlin's optional parameters in MethodParameter.isOptional(), reduces BeanUtils.findPrimaryConstructor to Kotlin semantics (for reuse in AutowiredAnnotationBeanPostProcessor), and finally introduces a common KotlinDetector delegate with an isKotlinType(Class) check.

Issue: SPR-15877
Issue: SPR-16020
2017-09-28 00:31:12 +02:00
Juergen Hoeller efce7902c4 Polishing 2017-09-27 01:34:11 +02:00
Juergen Hoeller 9d8e3d4185 Explicit check for duplicates in addClassPathManifestEntries
Issue: SPR-15989
2017-09-26 11:49:49 +02:00
Sebastien Deleuze 3996f33399 Support non-standard classes in Kotlin reflection discovery methods
Issue: SPR-15999
2017-09-24 23:10:40 +02:00
Juergen Hoeller e2882fe1db Build against EE 8 API level wherever possible
Upgrade to JAXB 2.3, JAX-WS 2.3, Annotations 1.3.1, Interceptor 1.2.1.
Also includes Log4J 2.9.1 and Asciidoctor 1.5.6.
2017-09-24 17:18:21 +02:00
Juergen Hoeller 9190b76ab9 Latest dependency updates (POI 3.17, Rome 1.8, EhCache 3.4, Caffeine 2.5.6, RxJava 2.1.4, Tomcat 8.5.21, JRuby 9.1.13, Rhino 1.7.7.2) 2017-09-23 11:28:19 +02:00
Juergen Hoeller 7ae59d0c2a Nullability refinements on private and static methods
Based on IntelliJ IDEA 2017.3 introspection results.

Issue: SPR-15756
2017-09-22 18:22:14 +02:00
Sebastien Deleuze 6c4a103f70 Remove support for generics nullability for now
See https://github.com/Kotlin/KEEP/issues/79
2017-09-21 18:44:27 +02:00
Juergen Hoeller 15c82afc1c Consistent conversion of Optional array/list arrangements
Issue: SPR-15918
Issue: SPR-15919
Issue: SPR-15676
2017-09-20 18:28:49 +02:00
Juergen Hoeller 185c2bf5b6 Upgrade to ASM 6.0
Issue: SPR-14514
2017-09-19 13:49:32 +02:00
Juergen Hoeller 346d2edce1 Revised org.springframework.lang javadoc
Issue: SPR-15756
2017-09-18 23:59:11 +02:00
Sebastien Deleuze 1bc93e3d0f Revisit nullability annotations
This commit introduces the following changes.

1) It adds a new Spring @NonNull annotation which allows to apply
@NonNullApi semantic on a specific element, like @Nullable does.
Combined with @Nullable, it allows partial null-safety support when
package granularity is too broad.

2) @Nullable and @NonNull can apply to ElementType.TYPE_USE in order
to be used on generic type arguments (SPR-15942).

3) Annotations does not apply to ElementType.TYPE_PARAMETER anymore
since it is not supported yet (applicability for such use case is
controversial and need to be discussed).

4) @NonNullApi does not apply to ElementType.FIELD anymore since in a
lot of use cases (private, protected) it is not part for the public API
+ its usage should remain opt-in. A dedicated @NonNullFields annotation
has been added in order to set fields default to non-nullable.

5) Updated Javadoc and reference documentation.

Issue: SPR-15756
2017-09-15 13:26:41 +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
Brian Clozel 397fd24849 Revert "Leverage Kotlin plugin dependency management"
This reverts commit 3e2f6c848a.
2017-08-22 21:29:39 +02:00
Sebastien Deleuze 3e2f6c848a Leverage Kotlin plugin dependency management 2017-08-22 17:35:57 +02:00
Sebastien Deleuze ab6430569d Efficient Kotlin metadata detection
Follow-up of 3991ab4a23.

Issue: SPR-15673
2017-08-22 16:22:25 +02:00
Brian Clozel cc3d7d2d48 Apply dependency management to selected modules
This commit applies the Dependency Management Plugin to modules that
require it; right now Spring Framework is importing BOMs for Netty and
Reactor dependencies only.

Instead of applying those BOMs to all modules, they're applied only
where they're needed.

Issue: SPR-15885
2017-08-21 14:42:03 +02:00
Brian Clozel 2eeb428e95 Move modules to independent build files
The main `build.gradle` file contains now only the common build
infrastructure; all module-specific build configurations have
been moved to their own build file.

Issue: SPR-15885
2017-08-21 14:41:55 +02:00
Juergen Hoeller 3991ab4a23 Efficient Kotlin metadata detection
Issue: SPR-15673
2017-08-21 01:33:20 +02:00
Sebastien Deleuze 73cf07e9a4 Fix overridden methods nullability
Issue: SPR-15869
2017-08-17 15:02:59 +02:00
Juergen Hoeller fabc9c28d7 Align new FileSystemUtils NIO implementation with original behavior
Issue: SPR-15845
Issue: SPR-15846
2017-08-03 14:21:00 +02:00
Juergen Hoeller 26de6268aa Polishing 2017-07-27 16:06:56 +02:00
Juergen Hoeller fac83b2e7c Consistent logging in Environment and PropertySource implementations
Issue: SPR-15825
2017-07-27 16:02:18 +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
Juergen Hoeller e4651d6b50 XmlEventDecoder uses common defensive XMLInputFactory (now in StaxUtils)
Issue: SPR-15797
2017-07-20 13:17:27 +02:00
Sebastien Deleuze fa4d139684 Support instantiating Kotlin classes with optional parameters
This commit updates BeanUtils class in order to add Kotlin optional
parameters with default values support to the immutable data classes
support introduced by SPR-15199.

Issue: SPR-15673
2017-07-20 10:44:06 +02:00
Juergen Hoeller 46eba3dbfa Nullability fine-tuning around declaration inconsistencies
Issue: SPR-15720
Issue: SPR-15792
2017-07-19 22:22:20 +02:00
Juergen Hoeller 9fc4fb10b0 Nullability fine-tuning around bean properties
Issue: SPR-15720
Issue: SPR-15792
2017-07-19 11:43:58 +02:00
Sebastien Deleuze fb4ddb0746 Make getters and setters null-safety consistent
This commit ensure that null-safety is consistent between
getters and setters in order to be able to provide beans
with properties with a common type when type safety is
taken in account like with Kotlin.

It also add a few missing property level @Nullable
annotations.

Issue: SPR-15792
2017-07-19 09:07:56 +02:00
Sebastien Deleuze e2fd04dff3 Add a [] Kotlin extension for PropertyResolver#getRequiredProperty 2017-07-19 08:12:32 +02:00