Commit Graph

1940 Commits

Author SHA1 Message Date
stsypanov cb4d6f097c Use StringJoiner where possible to simplify String joining 2019-03-07 16:51:18 +01:00
Sam Brannen f087fd5a93 Report offending class in SpringFactoriesLoader in exception message
Prior to this commit, the exception message generated by
instantiateFactory() in SpringFactoriesLoader did not report the
offending class in the top-level exception message. The offending class
was in fact included in the message of the nested exception, but the
top-level exception message on its own was a bit misleading.

This commit improves the diagnostics for such failures by including the
offending class and the target factory type in the top-level exception
message.

Closes gh-22453
2019-03-06 16:44:41 +01:00
Konrad Kamiński 9302cb2f85 Support Kotlin suspending functions in MethodParameter
Before this commit, the return type for Kotlin suspending functions
(as returned by MethodParameter#getParameterType and
MethodParameter#getGenericReturnType methods) was incorrect.

This change leverages Kotlin reflection instead of Java one
to return the correct type.

Closes gh-21058
2019-03-06 10:14:34 +01:00
Rossen Stoyanchev 9e7f557b4a Updates for buffer management in RSocket
- Integration tests run with zero copy configuration.
- RSocketBufferLeakTests has been added.
- Updates in MessagingRSocket to ensure proper release

See gh-21987
2019-03-04 23:35:43 -05:00
Sam Brannen 70cf597484 Remove obsolete overview.html files 2019-03-04 14:07:48 +01:00
Brian Clozel 3ac1dddb9d Merge branch '5.1.x' 2019-03-04 13:58:41 +01:00
Andrew Tulloch 090aceb3ad Fix repeated calls to DataBuffer.write(CharSequence, Charset)
Prior to this commit, repeated calls to `DataBuffer.write(CharSequence,
Charset)` would not write the given chars to the expected position in
the original buffer.

This commit fixes that by writing to the `outBuffer.position()`, offset
by the current `DataBuffer.writePosition()`.

Fixes gh-22484
2019-03-04 13:37:06 +01:00
Juergen Hoeller a7db395d9b Merge branch '5.1.x' 2019-02-28 19:29:04 +01:00
Juergen Hoeller 5d8a34fee6 Only prefer JDK 9+ Lookup.defineClass API if ClassLoader matches
Closes gh-22416
2019-02-28 19:28:03 +01:00
Juergen Hoeller fc7948c96b Merge branch '5.1.x' 2019-02-27 17:34:46 +01:00
Juergen Hoeller e583da0725 Polishing 2019-02-27 17:26:53 +01:00
Sam Brannen 40da78e9df Polishing 2019-02-27 16:30:05 +01:00
Juergen Hoeller bc0317af3b Merge branch '5.1.x' 2019-02-25 17:57:49 +01:00
Juergen Hoeller 9eb7f7e294 Polishing 2019-02-25 17:36:37 +01:00
Sebastien Deleuze dc8fb8bc5e Use StringJoiner where possible to simplify String joining 2019-02-25 12:11:57 +01:00
olszewskimichal 60a7909fca getFirst - check that values is not empty 2019-02-16 11:55:23 +01:00
Juergen Hoeller 6db75956b9 Merge branch '5.1.x' 2019-02-15 17:16:28 +01:00
Juergen Hoeller e307dd58db Polishing 2019-02-15 17:06:11 +01:00
stsypanov 5e29ea30a3 Use StringJoiner where possible to simplify String joining 2019-02-15 14:55:35 +01:00
stsypanov e7dc439f90 Simplify ConcurrentReferenceHashMap 2019-02-15 14:27:43 +01:00
stsypanov d2bfca7900 Extract duplicated code into a separate method 2019-02-15 14:26:44 +01:00
stsypanov 92053bb84e Some very simple improvements regarding ArrayList 2019-02-15 14:25:13 +01:00
Juergen Hoeller 5e0cd9fb60 Merge branch '5.1.x' 2019-02-14 13:39:58 +01:00
Juergen Hoeller ac0e5d8ec6 DefaultConversionService properly converts Object[] to int[]
Closes gh-22410
2019-02-14 13:38:29 +01:00
Juergen Hoeller 4e47006a17 Merge branch '5.1.x' 2019-02-12 09:09:19 +01:00
Juergen Hoeller 106a757098 Polishing 2019-02-12 09:07:58 +01:00
Juergen Hoeller 8637540678 Expose empty annotation array as empty AnnotationAttributes array
Closes gh-22405
2019-02-12 09:07:51 +01:00
Brian Clozel fb4a28f904 Polish
See gh-22340
2019-02-11 10:45:50 +01:00
Juergen Hoeller 783a7ca46b Merge branch '5.1.x' 2019-02-08 18:16:27 +01:00
Juergen Hoeller ba0c48b933 Polishing 2019-02-08 18:02:28 +01:00
Brian Clozel 05d7ab4328 Merge branch '5.1.x' 2019-02-06 20:00:02 +01:00
Brian Clozel ef8652615c Log exception at ERROR level in CompositeLog
Fixes gh-22364
2019-02-06 19:58:41 +01:00
Juergen Hoeller 34ddb1e3cd Merge branch '5.1.x' 2019-02-05 16:32:58 +01:00
Juergen Hoeller 9895e44d73 Polishing 2019-02-05 16:03:24 +01:00
Juergen Hoeller 643a68f81b Detect existing jar URLs from URLClassLoader.getURLs()
Closes gh-22346
2019-02-05 16:02:50 +01:00
Sebastien Deleuze 0b9522c84e Migrate Kotlin Mockito tests to Mockk
Closes gh-22345
2019-02-05 15:47:08 +01:00
Juergen Hoeller 4c9ae6494f Concurrency/nullability fine-tuning in MimeType(Utils)
See gh-22340
2019-02-05 15:38:41 +01:00
Brian Clozel 1bf3b36ce8 Polish
See gh-22340
2019-02-05 15:06:33 +01:00
Brian Clozel ba8849dda3 Avoid MimeType garbage creation
Prior to this commit, calls to `MimeType` and `MediaType` would create a
significant amount of garbage:

* during startup time, in the static sections of `MimeType` and
`MediaType` when creating well-known types
* at runtime, when parsing media types for content negotiation or
writing known media types as strings in HTTP response headers

This commit does the following:

* Avoid parsing the well-known types and use regular constructors
instead
* Cache types in a simple LRU cache once they've been parsed, since an
application is likely to deal with a limited set of types
* Avoid using `java.util.stream.Stream` in hot code paths

Benchmarks show that a complete revision of the `MimeTypeUtils` parser
is not required, since the LRU cache is enough there.

Closes gh-22340
2019-02-05 14:33:43 +01:00
Brian Clozel 862fa557bd Avoid java.util.stream.Stream usage in hot paths
Prior to this commit, profiling sessions would show that using
`java.util.stream.Stream` in some hot code paths creates significant
garbage.

Where streams aren't really required, this commit turns those snippets
into imperative logic  because those are likely to be called once or
multiple times per request.

Closes gh-22341
2019-02-05 12:14:51 +01:00
Juergen Hoeller d27bae245a Polishing 2019-02-05 00:45:28 +01:00
Juergen Hoeller a27a6470f7 Polishing 2019-02-05 00:10:22 +01:00
stsypanov 248d3f8e8b Use AtomicInteger instead of unsafe increment on volatile fields 2019-02-04 23:22:20 +01:00
Juergen Hoeller 80385ced4c Remove java.sql dependency from ReflectionUtils/TransactionDefinition
Fixes gh-21996
2019-01-28 22:50:11 +01:00
Arjen Poutsma 4732f83d70 Fix Java 9 Build
Fix Java 9 build by replacing deprecated method.
2019-01-24 15:44:58 +01:00
Brian Clozel 2b65d0e51f Fix error when writing empty String to DataBuffer
Prior to this commit, `DataBuffer.write` would throw an
`IllegalStateException` when called with an empty `String`, since the
`CharsetEncoder` would be flushed on an incorrent state.

This commit skips entirely the encoding phase for empty `String`.

Fixes #22262
2019-01-17 11:09:48 -05:00
Juergen Hoeller 72dddfbc7b Polishing 2019-01-09 12:26:58 +01:00
Andrzej Leśkiewicz 952045c216 SPR-17606 @Profile mishandles "not" operand mixed with "&" (#2066)
Correct handling of not/and expressions in ProfilesParser

Issue: SPR-17606
2019-01-08 22:24:15 +01:00
Juergen Hoeller f56fa91430 Polishing 2019-01-08 17:11:34 +01:00
Juergen Hoeller 9cb5369cb9 DependencyDescriptor supports TypeDescriptor resolution for fields
This allows for proper nested type conversion in @Value Optional fields analogous to method parameters, through a new TypeDescriptor-based method in the TypeConverter SPI. As an additional and less involved measure that is worth backporting, DefaultListableBeanFactory defensively checks for pre-converted Optional wrappers.

Issue: SPR-17607
2019-01-08 17:11:27 +01:00
Rossen Stoyanchev 673a20cb10 Defensive initialization of AsyncXMLInputFactory
Aalto's InputFactoryImpl already disables loading of external entities
by default (property "javax.xml.stream.isSupportingExternalEntities").
This commit goes further by applying the same defensive measures as we
do elsewhere for XMLInputFactory, which disables DTD completely.
Arguably there is no good reason to enable that by default in WebFlux.
2019-01-07 13:52:46 -05:00
Rossen Stoyanchev 4b24bcb799 More accurate checks for presence of MediaType.ALL
Typically a straight up equals as well as Collections#contains
checks for MediaType.ALL is susceptible to the presence of
media type parameters.

This commits adds equalsTypeAndSubtype as well as an
isPresentIn(Collection<MimeType>) methods to MimeType to faciliate
with checks for MediaType.ALL.

Issue: SPR-17550
2019-01-02 14:32:50 -05:00
Sebastien Deleuze 78a6429c32 Document NumberUtils.parseNumber() trim behavior
Issue: SPR-9523
2018-12-28 09:58:25 +01:00
Juergen Hoeller 31a24720a6 Consistent support for EnumSet subclasses in CollectionFactory
Issue: SPR-17619
2018-12-25 13:20:31 +01:00
Arjen Poutsma 5a8b8b11e4 Add test for calculateCapacity
Issue: SPR-17558
Closes gh-2054
2018-12-20 21:34:15 +01:00
Arjen Poutsma a00be62b04 Calculating capacity before allocation.
This commit optimizes the `CharSequenceEncoder` to allocate `DataBuffer`
instances with a predicted capacity.

Issue: SPR-17558
2018-12-20 21:33:50 +01:00
Brian Clozel 4955d08f28 Use DataBuffer.write in CharSequenceEncoder
Since SPR-17558, `DataBuffer` now offers a new method to write Strings
to them. This commit makes `CharSequenceEncoder` use that.

Issue: SPR-17558
2018-12-20 21:33:44 +01:00
Brian Clozel 6361b0cb23 Write CharSequence instances to DataBuffers
Prior to this commit, one could write a `CharSequence` to an existing
`DataBuffer` instance by turning it into a byte array or `ByteBuffer`
first. This had the following disadvantages:

1. Memory allocation was not efficient (not leveraging pooled memory
when available)
2. Dealing with `CharsetEncoder` is not always easy
3. `DataBuffer` implementations, like `NettyDataBuffer` can use
optimized implementations in some cases

This commit adds a new `DataBuffer#write(CharSequence, Charset)` method
for those cases and also an `ensureCapacity` method useful for checking
that the current buffer has enough capacity to write to it..

Issue: SPR-17558
2018-12-20 21:33:33 +01:00
stsypanov 112cc70231 Improve performance of ConcurrentReferenceHashMap creation 2018-12-13 16:57:48 +01:00
igor-suhorukov 93189a6733 String.indexOf() expressions can be replaced with a call to the String.contains() method available in Java 5 and newer. 2018-12-13 12:29:31 +01:00
Juergen Hoeller c48672c4c7 ParameterNameDiscoverer may return individual null entries in an array
Issue: SPR-17565
2018-12-12 21:56:17 +01:00
Rossen Stoyanchev 38ae282c3b Update log category precision for all tests
Replace the full category capped at 36 chars with the class name only
and 1 char per package, e.g. org.apache.commons.Foo -> o.a.c.Foo
2018-12-12 11:40:33 -05:00
Juergen Hoeller 0ad35053fb Upgrade to CGLIB 3.2.10
Includes upgrade to JarJar 1.7.2 and Tomcat 9.0.14.

Issue: SPR-17595
2018-12-12 16:03:31 +01:00
Juergen Hoeller 6eb0a60df9 Polishing 2018-12-12 11:16:53 +01:00
Juergen Hoeller aaaf81ed99 Polishing 2018-12-06 15:53:57 +01:00
Juergen Hoeller 50e5bdb813 Clarified VfsResource constructor
Issue: SPR-17563
2018-12-04 22:09:06 +01:00
Juergen Hoeller 6d7827e36b Polishing 2018-12-03 23:53:00 +01:00
Juergen Hoeller d5dab12909 NettyDataBufferFactory.join returns single-element buffer as-is
Issue: SPR-17560
2018-12-03 23:52:35 +01:00
Sam Brannen a528407d0c Suppress warning 2018-11-23 18:05:47 +01:00
Sam Brannen 81fde5ec41 Ensure that MethodParameter.findParameterIndex() is thread-safe
Prior to this commit, parallel invocations of
MethodParameter.findParameterIndex() (invoked indirectly via
SynthesizingMethodParameter.forParameter() and
MethodParameter.forParameter()) could intermittently lead to an
IllegalArgumentException being thrown due to a race condition in the
internal implementation of the JDK's
java.lang.reflect.Executable.getParameters() method.

This commit addresses this issue by introducing a fallback for-loop
that iterates over the candidate parameters a second time using
equality checks instead of identity checks.

Issue: SPR-17534
2018-11-23 17:37:20 +01:00
Juergen Hoeller 56234fe877 Polishing 2018-11-22 22:03:36 +01:00
Juergen Hoeller 262c702da4 CachingMetadataReaderFactory releases shared cache Map on clearCache()
LocalResourceCache properly initializes cacheLimit on construction.

Issue: SPR-17527
2018-11-22 11:20:47 +01:00
Juergen Hoeller fef0e21d8b Remove unused LinkedList import 2018-11-20 22:16:51 +01:00
Juergen Hoeller 8c7579eba8 Polishing 2018-11-20 22:06:44 +01:00
stsypanov 02d3cfa42d Use ArrayList instead of LinkedList 2018-11-20 21:54:51 +01:00
Vojtech Janota 12f168290d SPR-17492: FastByteArrayOutputStream.read byte-to-int conversion 2018-11-20 17:08:01 +01:00
Arjen Poutsma 63275ae2b7 Add Test for LeakAwareDataBufferFactory 2018-11-19 16:56:25 +01:00
Juergen Hoeller ce5c65c0b0 Upgrade to JAXB 2.3.1, Groovy 2.5.4, Jetty 9.4.14, Tomcat 9.0.13
Includes JAX-WS 2.3.1, Awaitility 3.1.3, OkHttp 3.12, Woodstox 5.2.
2018-11-19 12:41:26 +01:00
Stephane Nicoll 7b6f2f8fb3 Polish contribution
Closes gh-2019
2018-11-19 08:45:33 +01:00
Hanope bfb49c7249 Fix typos
See gh-2019
2018-11-19 08:41:21 +01:00
Arjen Poutsma 539cfc24c6 Refactor AbstractEncoderTestCase
Refactor AbstractEncoderTestCase to resemble AbstractDecoderTestCase

Issue: SPR-17449
2018-11-16 14:33:26 +01:00
Arjen Poutsma 39ce989d1a Add and use AbstractDecoderTestCase
Introduce new base test case for decoder tests, and use it.

Issue: SPR-17449
2018-11-16 14:33:26 +01:00
Rossen Stoyanchev ba3fef3e8a Refactor media types parsing improvements
Issue: SPR-17459
2018-11-13 23:02:09 -05:00
Dimitrios Liapis f4b05dc2e7 MediaType parsing supports comma inside quotes
Issue: SPR-17459
2018-11-13 16:59:57 -05:00
Arjen Poutsma 4182935b7a Revert optimization in StringDecoder
This commit reverts the first optimizations listed in
fa096dc60f, as the default delimiters
do vary, namely by the charset given in the message mime type.
The mimetype charset might not be compatible with ASCII (i.e. anything
but UTF-8 or ISO-8859-1, for instance it might be UTF-16), and will not
successfully find the default delimiters as a consequence.

Added test to indicate the bug.
2018-11-13 13:38:13 +01:00
Arjen Poutsma 3bab3515b1 Add and use AbstractEncoderTestCase
Introduce new base test case for encoder tests, and use it.

Issue: SPR-17449
2018-11-13 13:35:37 +01:00
Arjen Poutsma 0c0de851f4 Add LeakAwareDataBufferFactory
Introduce a data buffer factory that can check for memory leaks in
@After methods.

Issue: SPR-17449
2018-11-13 13:35:37 +01:00
Arjen Poutsma e31914bada Polishing 2018-11-13 13:35:37 +01:00
Juergen Hoeller 40148c0560 Consistent use of ResolvableType.toClass() for assignability checks
Issue: SPR-17086
2018-11-12 20:29:37 +01:00
Rossen Stoyanchev c187cb2fa1 Ensure client response is drained with onStatus hook
Issue: SPR-17473
2018-11-08 22:41:22 -05:00
Juergen Hoeller e26ae9853e Up-to-date version and link in ASM/CGLIB/Objenesis package javadoc
Issue: SPR-17267
Issue: SPR-17372
2018-11-08 16:56:48 +01:00
Juergen Hoeller d9c1811d21 Deprecate NON_BRIDGED_METHODS constant as of 5.0.11 as well
Issue: SPR-17464
2018-11-05 22:59:18 +01:00
Juergen Hoeller 2ac4355ec0 ASM ClassReader leniently handles label offset mismatch (again)
Issue: SPR-17467
2018-11-05 17:44:23 +01:00
Juergen Hoeller a3cd7af72d Polishing 2018-11-05 12:27:35 +01:00
Juergen Hoeller 0a7dcf14f9 Deprecate ReflectionUtils.invokeJdbcMethod (for removal in 5.2)
Issue: SPR-17464
2018-11-05 12:26:20 +01:00
Rossen Stoyanchev 133b8b0b5a Polish 2018-11-02 16:19:53 -04:00
Juergen Hoeller dc8f6f7177 Upgrade to CGLIB 3.2.9
This CGLIB upgrade literally does not make any difference to Spring users since its only purpose is a default ASM7 declaration in its AsmApi class (which we patched a month ago). We nevertheless leave our local AsmApi copy in place for the time being, allowing for an individual upgrade of the declared ASM API version in the future.

Issue: SPR-17267
Issue: SPR-17371
2018-11-02 19:55:13 +01:00
Rossen Stoyanchev fa096dc60f Minor refactoring in StringDecoder + polish
1. Avoid re-creating the List with delimited byte arrays on every
request if using the default delimiters which don't vary by charset.

2. Replace flatMap with flatMapIterable for splitOnDelimiter.

3. Avoid going through DataBufferUtils#join, and unnecessarily creating
Flux from the List, since the join method needs a list anyway.
2018-10-26 13:24:53 -04:00
Juergen Hoeller ffa032e78f Polishing 2018-10-24 20:46:26 +02:00
Arjen Poutsma 488a1d4561 Review DataBufferUtils for cancellation memory leaks
Issue: SPR-17408
2018-10-24 16:28:21 +02:00
Arjen Poutsma 51bb96db47 Fix ResourceRegionEncoder and tests
Fix ResourceRegionEncoder so that it checks for resource existance
before writing boundaries. Also defer data buffer allocation until
necessary.

Issue: SPR-17419
2018-10-23 16:41:48 +02:00
Arjen Poutsma eac9e66c46 Fix memory leak when canceling read from AsynchronousFileChannel
This commit fixes a memory leak that occurs when reading from a
AsynchronousFileChannel, and cancelling the subscription.

Issue: SPR-17419
2018-10-23 16:41:48 +02:00
Juergen Hoeller f68b1e0bce Upgrade to Objenesis 3.0.1
Issue: SPR-17372
2018-10-22 18:54:18 +02:00
Juergen Hoeller c3c2383b0d Align serialVersionUID declaration with ASM master
Issue: SPR-17267
2018-10-22 18:53:23 +02:00
Arjen Poutsma 946ec7e22e Fix memory leaks in ProtobufDecoder
Issue: SPR-17418
2018-10-22 16:00:32 +02:00
Arjen Poutsma a64e85fcc6 Javadoc 2018-10-22 16:00:32 +02:00
Arjen Poutsma f738273486 Fix buffering issue in StringDecoder
Issue: SPR-17418
2018-10-22 16:00:32 +02:00
Juergen Hoeller dd2ce20687 SpringFactoriesLoader tolerates whitespace around class names
Issue: SPR-17413
2018-10-22 15:13:58 +02:00
Juergen Hoeller 83a54dba7e Avoid stacktrace if root resource is not resolvable in file system
Issue: SPR-17417
2018-10-22 15:13:49 +02:00
Arjen Poutsma 149d416e8e Review DataBufferUtils for error/cancellation memory leaks
Issue: SPR-17408
2018-10-19 12:16:18 +02:00
Juergen Hoeller 7ff938b3ef LogFormatUtils.formatValue leniently handles toString() exceptions
Issue: SPR-17397
2018-10-18 18:04:32 +02:00
Sebastien Deleuze 2c5a1af236 Leverage Java reflection for Kotlin enums
As discussed in KT-25165, from a Kotlin POV enum constructors
have no parameter, this is an "implementation detail"
required for running on the JVM, so it seems relevant to skip
Kotlin reflection in that case and just delegate to Java
reflection.

Issue: SPR-16931
2018-10-16 16:40:02 +02:00
Juergen Hoeller b7e4a56e5c Mark PathResourceTests as deprecated (along with PathResource)
Issue: SPR-17320
2018-10-12 13:17:28 +02:00
Juergen Hoeller dcf2861db5 Upgrade to Objenesis 3.0
Includes jarjar upgrade since jarjar 1.3 fails to properly relocate Objenesis 3.0 classes into org.springframework.objenesis package.

Issue: SPR-17372
2018-10-12 13:17:01 +02:00
Juergen Hoeller 5474995288 Exclude original AsmApi class from CGLIB repack jar
Issue: SPR-17371
2018-10-12 12:14:00 +02:00
Juergen Hoeller a2ae5f6972 Force CGLIB to always specify ASM7 for its visitors
Issue: SPR-17371
2018-10-12 12:01:50 +02:00
Juergen Hoeller 053820c4ff Polishing 2018-10-09 23:14:49 +02:00
Juergen Hoeller 83909e6e1e Consistent exposure of empty attribute arrays in AnnotationMetadata
Issue: SPR-17347
2018-10-09 23:14:13 +02:00
Juergen Hoeller fdf340306d Defensively use Class.forName instead of ClassLoader.loadClass
Issue: SPR-17333
2018-10-09 23:14:05 +02:00
Juergen Hoeller cf3635b42d Resource.lastModified() propagates 0 value if target resource exists
Includes use of Files.getLastModifiedTime for NIO Paths, preservation of NIO-based resolution on createRelative, deprecation of PathResource, and consistent use of getContentLengthLong over getContentLength.

Issue: SPR-17320
2018-10-09 23:13:11 +02:00
Juergen Hoeller 1e0de072f9 Upgrade to ASM 7.0 beta release
Issue: SPR-17267
2018-10-09 23:13:02 +02:00
Rossen Stoyanchev c01f350abe Move MonoToListenableFutureAdapter to spring-core
This was a package private class in spring-messaging since 5.0, and was
recently made public in 5.1. This commit promotes it to spring-core
where it belongs next to all other ListenableFuture support classes.

Follow-up refactoring for SPR-17336
2018-10-09 16:26:24 -04:00
Sam Hubbard 80e7819d6f Fix construction of NullSafeComparator in nullsLow
Previously, both nullsLow(Comparator<T>) and
nullsHigh(Comparator<T>) returned a
NullSafeComparator which treated nulls as being
high. This commit corrects this typo.
2018-10-05 13:20:28 +02:00
www 9d5aced8c5 Fix formatting
Prefix the opening brace with a single space in some classes.
Replace tab character with space in javadoc of AttributeAccessor.
Also fix some other trivial formatting errors.

Closes gh-1979
2018-10-05 09:20:47 +02:00
Juergen Hoeller ad29f97a05 Polishing 2018-09-29 17:16:25 +02:00
Rossen Stoyanchev a6f9c4c599 LogFormatUtils is declared abstract 2018-09-19 11:54:05 -04:00
Arjen Poutsma 8a4835368d Use doOnDiscard to free internally queued data buffers
Issue: SPR-17246
2018-09-19 13:24:45 +02:00
Juergen Hoeller c634b2fae7 ResolvableType-based resolution uses BeanNamesByType cache if possible
Issue: SPR-17282
2018-09-18 15:30:43 +02:00
Juergen Hoeller 69e8bcdf40 Checkstyle updates from ASM master
Issue: SPR-17267
2018-09-17 19:09:07 +02:00
Juergen Hoeller 8e83f140d4 Polishing 2018-09-15 00:17:17 +02:00
Rossen Stoyanchev db8e9eafb2 Add LogFormatUtils
1. Helper method to eliminate duplication in formatting (de-)serialized
   values for logging introduced with prior commit #e62298.

2. Helper method for TRACE vs DEBUG logging with different details.

Issue: SPR-17254
2018-09-14 18:06:46 -04:00
Juergen Hoeller 41d4cb5cbf Ordered stream access on ObjectProvider with strong order guarantees
Issue: SPR-17272
2018-09-14 23:56:25 +02:00
Rossen Stoyanchev e62298eaad Truncate logged encoded and decoded values if necessary
At DEBUG show up to 100 chars, at TRACE show full formatted value.

Note that the formatValue helper method is duplicated a number of times
in this commit. A utility method will likely be added in spring-core
through an extra commit.

Issue: SPR-17254
2018-09-14 12:20:03 -04:00
Juergen Hoeller 65c8fa400f Consistent ordered list access and lazy streaming for ObjectProvider
Includes fallback match for collection/map dependency if qualified.

Issue: SPR-17272
Issue: SPR-17197
2018-09-13 18:23:19 +02:00
Arjen Poutsma cde677a1f4 Fixed DefaultDataBuffer.toString() 2018-09-13 16:12:13 +02:00
Juergen Hoeller 45936f0ddd ClassReader revision from ASM master
Issue: SPR-17267
2018-09-12 12:26:29 +02:00
Arjen Poutsma f35f7db29b Removed deprecated methods. 2018-09-11 13:36:44 +02:00
Arjen Poutsma 09af706af6 Use concatWith instead of mergeWith 2018-09-11 13:36:44 +02:00
Arjen Poutsma 1a0522b805 DataBufferUtils does not release DataBuffer on error cases
This commit makes sure that in DataBufferUtils.write, any received data
buffers are returned as part of the returned flux, even when an error
occurs or is received.

Issue: SPR-16782
2018-09-11 13:36:44 +02:00
Juergen Hoeller 1da4d504c4 Upgrade to ASM master (7.0 beta) and CGLIB 3.2.8
Issue: SPR-17267
2018-09-11 13:10:45 +02:00
Juergen Hoeller c06b9525ac UriComponentsBuilder copies query params through MultiValueMap.addAll
Issue: SPR-17256
2018-09-10 11:31:37 +02:00
Juergen Hoeller e49896d95f Upgrade to Mockito 2.22, XMLUnit 2.6.2, JavaMail 1.6.2
Also includes Apache Johnzon 1.1.9.
2018-09-10 10:52:24 +02:00
Juergen Hoeller 84ec382201 XMLEventReader.getElementText() properly checks for start element
Issue: SPR-17233
2018-09-07 12:56:15 +02:00
Sebastien Deleuze 8d45e3e7ef Fix Kotlin inner class nested configuration handling
Before this commit, Kotlin inner class nested configuration
handling thrown an IndexOutOfBoundsException due to bogus filtering
of its constructor parameter reference to an instance of the outer
class.

This commit keep constructor parameter of type INSTANCE in order to
throw a more meaningful NoSuchBeanDefinitionException.

Issue: SPR-17222
2018-09-07 11:39:30 +02:00
Arjen Poutsma 259b2ca5f4 Added tests for errors in the source stream
This commit adds decoder/message-reader tests for errors in
the source data buffer publisher. Because the tests extend
AbstractDataBufferAllocatingTestCase, they also check whether
the buffers that precede the error in the stream are properly
released.

Issue: SPR-17025
2018-09-05 11:08:07 +02:00
Arjen Poutsma 196c0adf47 Fixed DataBufferUtils.join leak for error in source
This commit fixes an issue where DataBufferUtils.join() would not
release databuffers that preceded an error signal.

Issue: SPR-17025
2018-09-05 11:07:57 +02:00
Sam Brannen 326895246d Polishing 2018-09-04 13:55:22 +02:00
Stephane Nicoll 2c1dca5b5e Polish capitalisation of units on DataSize and javadoc of DataUnit
Issue: SPR-17240
2018-09-04 13:46:41 +02:00
stsypanov 7dba79c7c1 Use String::isEmpty instead of "".equals(arg) when arg is not null 2018-08-26 22:48:21 +02:00
Sam Brannen 08ba53dd0e Ensure SocketUtils can be instantiated
Issue: SPR-17215
2018-08-26 21:49:21 +02:00
Sam Brannen f6ee2508ef Clean up warning in AnnotatedElementUtils 2018-08-23 18:24:18 +02:00
Juergen Hoeller 6ef0938a92 Defensive URL cleaning (preserving the original URL if possible)
Issue: SPR-17198
2018-08-22 14:12:39 +02:00
Juergen Hoeller a6a6cf7d97 Upgrade to Java Activation Framework 1.2 as API dependency
Includes XMLUnit 2.6.1 and Undertow 2.0.13.

Issue: SPR-16115
2018-08-17 16:01:15 +02:00
Juergen Hoeller 2ac23badee SimpleAliasRegistry.hasAlias properly resolves multiple chained aliases
Issue: SPR-17191
2018-08-17 09:54:14 +02:00
Juergen Hoeller 109a2b49e5 Consistently skip unnecessary search on superclasses and empty elements
Includes caching of declared annotation arrays and combined searching for several annotation types (used in SpringCacheAnnotationParser).

Issue: SPR-16933
2018-08-15 17:30:14 +02:00
Juergen Hoeller ac544924c8 Polishing 2018-08-13 14:36:37 +02:00
Sam Brannen 8126ffbc8c Fix broken links in JavaDoc
Issue: SPR-17174
2018-08-13 12:22:52 +02:00
Marten Deinum 5322fa0fb7 Use an import instead of FQCN
javax.xml.stream.Location is already there as an import there is no need
to use the FQCN in the handleDtd method.
2018-08-13 10:38:23 +02:00
Juergen Hoeller df51ff0386 Revert to Map entry iteration for less expensive static initialization
Issue: SPR-17169
2018-08-12 20:52:55 +02:00
Stephane Nicoll 30b8d47814 Polish 2018-08-12 10:49:29 +02:00
Juergen Hoeller 2b2a5a414b Polishing 2018-08-10 19:23:44 +02:00
Stephane Nicoll f931a3fb59 Improve DataSize to support negative values
Issue: SPR-17154
2018-08-10 18:21:09 +02:00
Juergen Hoeller aebb2d52e0 Logging refinements for transaction and cache processing (debug/trace)
Issue: SPR-16946
2018-08-10 15:45:46 +02:00
Stephane Nicoll 282a4ad2f6 Fix checkstyle violations 2018-08-10 14:43:16 +02:00
Stephane Nicoll 8a1588ae29 Add support for DataSize
This commit provides a data type to represents a size in bytes and other
standard unit.

Issue: SPR-17154
2018-08-10 14:28:46 +02:00
Sam Brannen 8ea913392c Link to Eclipse bug for annotations on bridge methods 2018-08-09 18:49:24 +02:00
Juergen Hoeller 65f29a39ca AbstractAspectJAdvisorFactory uses AnnotationUtils.getValue 2018-08-09 02:26:28 +02:00
Juergen Hoeller 4521a79b2d Find annotations on implemented generic superclass methods as well
Includes Java 8 getDeclaredAnnotation shortcut for lookup on Class.

Issue: SPR-17146
2018-08-08 23:52:47 +02:00
Sergey Chupov a06e63f619 Polishing javadocs: IllegalStateException no longer thrown
The dependency to Apache Commons has been removed in 51252ebbca (diff-95dc9d8756aa91afb2ac28454f1b634c), but the javadoc still mentions it.
2018-08-08 15:51:05 +02:00
Sam Brannen 7b608ab995 Ensure AnnotationUtilsTests pass in Eclipse again 2018-08-08 13:23:51 +02:00
Kazuhiro Sera be211ceead Fix typos detected by github.com/client9/misspell 2018-08-08 12:50:46 +02:00
Juergen Hoeller b325c74216 Pruning of outdated JDK 6/7 references (plus related polishing) 2018-08-07 20:36:47 +02:00
Juergen Hoeller 2b051b8b32 Deprecate support classes for Sun's JDK HTTP server
Issue: SPR-17143
2018-08-07 20:35:53 +02:00
Juergen Hoeller 2d05f2ed47 SerializableTypeWrapper detects Graal through system property as well
Issue: SPR-17136
2018-08-07 11:15:43 +02:00
Juergen Hoeller 6b82a6c38c Polishing 2018-08-07 02:47:00 +02:00
Juergen Hoeller d72d376f03 Avoid unnecessary annotation introspection on framework methods
Issue: SPR-16933
2018-08-07 01:35:32 +02:00
Juergen Hoeller 8a9d042320 Javadoc fix from ASM master (6.2.1)
Issue: SPR-16398
2018-08-06 18:33:41 +02:00
Juergen Hoeller 69c6a40c50 Consistent nullability for array/collection input parameters
Includes pre-sizing of LinkedHashSet for conversion from array.

Issue: SPR-17123
Issue: SPR-17074
2018-08-06 14:11:59 +02:00
Rossen Stoyanchev 5095ec40b5 takeUntilByteCount actually uses takeUntil
Issue: SPR-17188
2018-08-02 21:19:22 +03:00
Rossen Stoyanchev 542ed81d5c Polish 2018-08-02 21:19:22 +03:00
Juergen Hoeller 0001f87d59 Polishing 2018-08-01 12:52:50 +02:00
Juergen Hoeller 589b7048ec Avoid synthesizable annotation creation for @Bean/@Scope processing
Includes consistent (non-)use of AnnotationUtils/AnnotatedElementUtils.

Issue: SPR-16933
2018-08-01 11:43:28 +02:00
Juergen Hoeller 9b671f8408 Polishing 2018-07-31 23:57:19 +02:00
Juergen Hoeller 6cd9060183 Avoid synthesizable check for common annotation types
This revision considers any java/javax and org.springframework.lang annotations as not synthesizable upfront, checking not only in isSynthesizable but also at synthesizeAnnotation(Array) level.

Issue: SPR-16933
2018-07-31 20:54:10 +02:00
Juergen Hoeller 4a147d26fc Initialize pre-filled HashMaps with large enough capacity
Empty Maps are preferably initialized without capacity (not initializing them at all or lazily initializing with default capacity when needed).

Issue: SPR-17105
2018-07-30 22:07:31 +02:00
Juergen Hoeller c037e75f26 Improve debug logging at BeanDefinitionReader and BeanFactory level
Issue: SPR-17090
2018-07-27 17:46:05 +02:00
Juergen Hoeller e82efbc7e3 Declare ASM7_EXPERIMENTAL for full compatibility with JDK 11 bytecode
Issue: SPR-17096
2018-07-26 23:11:54 +02:00
Juergen Hoeller 9ab63b8494 ListBasedXMLEventReader uses defensive modifiable copy of given List 2018-07-25 19:03:13 +02:00
Juergen Hoeller 3881a4aded Polishing 2018-07-25 14:16:02 +02:00
Juergen Hoeller fd8e4abe5d Introduce ResolvableType.toClass() shortcut
Issue: SPR-17086
2018-07-25 14:15:19 +02:00
Juergen Hoeller fac2e35f96 Refactor util.log.LogUtils into core.log.LogDelegateFactory
Issue: SPR-17012
2018-07-24 14:44:34 +02:00
Sebastien Deleuze f8f8d28f08 Support running Kotlin apps without kotlin-reflect
This commit includes an optimization of BeansUtils#instantiateClass
that favors Java reflection for default constructors before leveraging
Kotlin one for finding primary constructors and avoids Kotlin related
conditions when running in Java.

Issue: SPR-17069
2018-07-23 09:54:48 +02:00
Juergen Hoeller bccff73e2b AspectJExpressionPointcut leniently ignores non-composable interfaces
Issue: SPR-17003
2018-07-22 22:28:48 +02:00
Juergen Hoeller cfbacfd89b Revise ResolvableType.as for introspection performance
This revision limits serializability of derived interfaces, superclasses and type parameters, optimizing for introspection performance instead.

Issue: SPR-17070
2018-07-22 17:49:53 +02:00
stsypanov 5051850fa9 SPR-17074 Replace iteration over Map::ketSet with Map::entrySet 2018-07-21 13:12:43 +02:00
Juergen Hoeller 9a43d2ec20 Revised log levels: less WARN and INFO, fine-tuned DEBUG vs TRACE
Issue: SPR-16946
2018-07-20 15:05:16 +02:00
Juergen Hoeller c4df335a1d ReflectiveMethodExecutor invokes interface method if possible
Issue: SPR-16845
2018-07-19 16:35:59 +02:00
Juergen Hoeller d0bbbf4cae OrderUtils caches order values (for AnnotationAwareOrderComparator)
Issue: SPR-17064
2018-07-19 11:58:42 +02:00
Rossen Stoyanchev 4d6f2df3cb Add LogUtils and HttpLogging
SPR-17012
2018-07-18 15:32:50 -04:00
Juergen Hoeller 23d4862017 Find annotations on implemented generic interface methods as well
Issue: SPR-16060
2018-07-18 19:44:30 +02:00
Sebastien Deleuze e8034f2f96 Adapt DefaultParameterNameDiscoverer to Graal constraints
When compiling or running as a Graal native image, no
ParameterNameDiscoverer is used.

Issue: SPR-17005
2018-07-18 17:17:47 +02:00
Juergen Hoeller cab35aa788 StringUtils.parseLocaleString detects variant without country
Includes tests for parsing all available locales on the JVM, checking toString/toLanguageTag equality between parsed and original locale.

Issue: SPR-7598
Issue: SPR-16651
2018-07-18 11:10:26 +02:00
Juergen Hoeller 88e4006790 CookieLocaleResolver is RFC6265 and language tag compliant by default
Like CookieLocaleResolver, LocaleChangeInterceptor parses both locale formats by default now. Since it does not need to render the locale, its languageTagCompliant property is not relevant anymore at all.

The parseLocale method in StringUtils validates the locale value now and turns an empty locale into null, compatible with parseLocaleString behavior and in particular aligned with web locale parsing needs.

Issue: SPR-16700
Issue: SPR-16651
2018-07-17 17:57:59 +02:00
Juergen Hoeller cacd14c805 Never return null from AnnotationMetadata.getMetaAnnotationTypes
Issue: SPR-17046
2018-07-16 18:05:10 +02:00
Juergen Hoeller f6fdffd663 Lazily retrieve delegate beans in AsyncConfigurer and CachingConfigurer
Introduces a configure method pattern for Supplier-style configuration and a common SingletonSupplier decorator for method reference suppliers. Also declares jcache.config and jcache.interceptor for non-null conventions.

Issue: SPR-17021
2018-07-14 19:29:32 +02:00
Rossen Stoyanchev 1b1bc7f5b5 Switch defaults and model for logging sensitive data
Issue: SPR-17029
2018-07-11 11:10:03 -04:00
Juergen Hoeller 6887802526 Fallback to ClassLoader.defineClass for Lookup.defineClass LinkageError
Issue: SPR-16902
2018-07-10 22:13:57 +02:00
Juergen Hoeller a1d209726c Upgrade to ASM master (6.2+) and CGLIB 3.2.7
Issue: SPR-16398
2018-07-10 18:51:01 +02:00
Juergen Hoeller 833343f17c Specifically rethrow IllegalAccessError in isPresent/resolveClassName
Issue: SPR-17018
2018-07-09 14:31:45 +02:00
Juergen Hoeller fd0220b85c Suppress rawtypes warning for createReferenceArray 2018-07-09 14:28:15 +02:00
stsypanov 6d6aa72e8f improve performance of projection instantiation 2018-07-09 13:39:23 +02:00
Rossen Stoyanchev 4bd22eeb13 Fallback logger for logging in http and codec packages
Issue: SPR-17012
2018-07-07 10:54:03 -04:00
Rossen Stoyanchev bca9f51092 Polish hint for suppressing logging at Encoder/Decoder 2018-07-06 20:32:08 -04:00
Juergen Hoeller d8c7270c00 Consistent Iterator/Stream support in PropertySources and PropertyValues
Issue: SPR-16894
2018-07-05 23:59:56 +02:00
Rossen Stoyanchev 82310660fd Correlated encoding/decoding log messages via hints
Issue: SPR-16966
2018-07-05 08:28:15 -04:00
Juergen Hoeller 5dc8b5de6d Polishing 2018-07-04 15:07:17 +02:00
Sebastien Deleuze 9b7a492bc9 Test RxReactiveStreams presence in ReactiveAdapterRegistry
Issue: SPR-17000
2018-07-03 18:00:47 +02:00
Sebastien Deleuze dcbaecea2a Perform explicit class checks in ReactiveAdapterRegistry
In order to allow Spring Framework applications running as GraalVM
native images, ReactiveAdapterRegistry should perform explicit class
checks instead of catching Throwable in order to avoid
UnsupportedFeatureError errors.

Issue: SPR-17000
2018-07-03 13:35:11 +02:00
Juergen Hoeller 779cf8d240 ConcurrentReferenceHashMap caches EntrySet in volatile field
Includes an efficient implementation of isEmpty(), not relying on a full entry count but rather backing out once a non-empty hash segment has been found.

Issue: SPR-16994
2018-07-02 22:32:57 +02:00
Juergen Hoeller 06f9fb9aeb Refine Class serializability check for actual Graal compatibility
Issue: SPR-16992
2018-07-02 22:32:29 +02:00
Juergen Hoeller e5a6711d29 Consistent final declaration for static delegate classes
Issue: SPR-16968
2018-07-02 13:55:18 +02:00
Juergen Hoeller 2ade122543 Bypass serializable type wrapping if java.lang.Class not serializable
Issue: SPR-16992
2018-07-02 13:55:03 +02:00
Juergen Hoeller 4ff1e3e74b Consistent abstract declaration for utility classes (plus polishing)
Issue: SPR-16968
2018-07-01 02:31:20 +02:00
Rossen Stoyanchev 907a306ee2 Fix locally failing test in FlushingIntegrationTests 2018-06-29 18:15:52 -03:00
Juergen Hoeller 40efcc933c Polishing 2018-06-28 14:51:33 +02:00
Juergen Hoeller b68e692854 Conventions lazily retrieves shared ReactiveAdapterRegistry
Issue: SPR-16981
2018-06-28 14:47:52 +02:00
Juergen Hoeller 7a02e438e7 StringUtils.cleanPath retains plain pointer to current directory
Issue: SPR-16908
2018-06-28 14:15:16 +02:00
Phillip Webb a89e716cc7 Use tabs rather than spaces in tests
Update tests to ensure that tabs are used instead of spaces. Also
consistently apply a new line at the end of each file.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 1c25cec44f Polish test code
Polish a few issue identified when adding checkstyle to the
build. Although checkstyle is not enforcing rules on tests,
these are a few minor changes that are still worth making.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 81451aa800 Organize imports
Reorganize imports to ensure consistent ordering. This commit also
expands any `.*` static imports in favor of using fully-qualified
method references.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb b220d94cc2 Never use parenthesis for single lambda arguments
Update all lambdas that take a single argument so that parenthesis
are never used.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 5cedd0d5d4 Consistently use tabs rather than spaces
Update code that has accidentally used spaces instead of tabs.
Also remove all trailing whitespace.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb ad6d183a06 Remove unneeded conditional logic
Update `ConversionUtils` to remove conditional logic that isn't
necessary.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 9de3689f63 Never use 'this.' when accessing loggers
Ensure that `this.` is never used when accessing loggers.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 0b53c1096a Always use 'this.' when accessing fields
Ensure that `this.` is used consistently when accessing class
fields.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb eeebd51f57 Use consistent class design
Update all classes so that inner classes are always last. Also
ensure that utility classes are always final and have a private
constructor and make exceptions final whenever possible.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb e9d1b39aff Apply consistent copyright header
Add copyright header to `package-info.java` files and fix a few
malformed headers on existing java files.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb c3a17dfd47 Ensure all files end with a newline
Update all files to ensure that they always end with a new line.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb e0480f75ac Fix javadoc checkstyle issues
Fix checkstyle violations for javadoc.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Juergen Hoeller 847202c8f8 MimeTypeUtils lazily initializes SecureRandom for multipart boundary
Issue: SPR-16974
2018-06-25 18:12:43 +02:00
Rossen Stoyanchev 900bc8a2e3 Logging improvements for WebFlux
Issue: SPR-16898
2018-06-22 22:44:24 -04:00
Sam Brannen cafb5033e2 Polishing 2018-06-19 13:50:13 +03:00
Sam Brannen bea0e399b8 Polish profile expression support
Issue: SPR-12458
2018-06-17 00:15:18 +03:00
Sam Brannen 4184ebe799 Polish profile expression support
Issue: SPR-12458
2018-06-16 21:40:22 +03:00
Juergen Hoeller 38f9a7b072 FileSystemResource supports java.nio.file.Path based setup
Issue: SPR-16833
2018-06-15 22:12:14 +02:00
Juergen Hoeller bb6ab5dc91 OS-independent alphabetical sorting of directory content
Issue: SPR-16838
2018-06-15 22:09:29 +02:00
Stephane Nicoll 1f3b4f1863 Polish "Add profile expression support"
Issue: SPR-12458
2018-06-15 16:01:16 +02:00
Phillip Webb e2623b7d35 Add profile expression support
Allow the `Environment` to accept a generic `Profiles` interface which
can support more complex matching rules. The previous
`acceptsProfiles(String...)` method now uses `Profiles.of` which
supports basic profile expressions such as "(a | b) & !c"

Issue: SPR-12458
2018-06-15 16:01:16 +02:00
Juergen Hoeller c38cb43527 MethodParameter strictly asserts parameter index -1 for return type
Issue: SPR-16889
2018-06-14 00:42:19 +02:00
Rossen Stoyanchev 0078f46779 Use reflection for JdkFlowAdapter
To avoid compiler issues on Eclipse.
2018-06-13 09:38:54 -04:00
Juergen Hoeller 0777a80efe Polishing
(cherry picked from commit a2765c0)
2018-06-11 19:17:57 +02:00
Brian Clozel 417354da8a Remove dependency management noise from POMs
Prior to this commit, the generated POMs for Spring Framework modules
would contain unneeded/harmful information from the Spring Framework
build:

1. The BOM imports applied to each module by the dependency
management plugin, for example for Netty or Reactor Netty.
Spring should not export that opinion to its POMs.

2. The exclusion of "org.slf4:jcl-over-slf4j" from *all* dependencies,
which made the POMs much larger than necessary and suggested to
developers that they should exclude it as well when using all those
listed dependencies. In fact, only Apache Tiles currently brings that
transitively.

This commit removes that information from the POMs.
The dependencyManagement Gradle plugin is disabled for POM generation
and we manually resolve the dependency versions during the generation
phase.
The Gradle build is streamlined to exclude "org.slf4:jcl-over-slf4j"
only when necessary.

Issue: SPR-16893
2018-06-11 15:57:54 +02:00
Juergen Hoeller b790bd1fd6 LinkedCaseInsensitiveMap explicitly implements put/computeIfAbsent
Issue: SPR-16926
2018-06-11 14:10:12 +02:00
Yun 28e402bc76 Prevent instantiation of AnnotatedElementUtils
Closes gh-1848
2018-06-11 08:32:03 +02:00
Rossen Stoyanchev 010352163b Eliminate the need for Encoder#getContentLength
Issue: SPR-16892
2018-06-04 15:48:47 -04:00
Sebastien Deleuze a7a29a8226 Revisit PropertyResolver Kotlin extensions
Issue: SPR-16883
2018-05-31 12:20:37 +02:00
Juergen Hoeller 616a40adb6 ClassPathResource.isReadable() returns false for content length 0
Issue: SPR-16832
2018-05-29 22:31:47 +02:00
Juergen Hoeller 74fcdea2d9 SimpleAliasRegistry logs info message for alias overriding
Issue: SPR-16871
2018-05-29 21:51:33 +02:00
Juergen Hoeller 46a89d9534 Restore lenient null return value for ConditionContext.getBeanFactory()
Includes nullable return value for getClassLoader() with corresponding notes in applicable javadoc.

Issue: SPR-16866
2018-05-29 21:51:06 +02:00
Juergen Hoeller 69f14a2038 ClassPathResource.isReadable() checks InputStream (for jar directories)
Resource.isReadable() is defined to semantically imply exists() now.

Issue: SPR-16832
2018-05-29 21:47:33 +02:00
Sebastien Deleuze 406f6ec74d Fix PropertyResolverExtensions.kt location 2018-05-28 15:51:22 +02:00
Juergen Hoeller 836a09d5c0 Upgrade to Woodstox 5.1, XMLUnit 2.6, Gson 2.8.5 2018-05-25 00:18:06 +02:00
Rossen Stoyanchev d58888777f Polish ReactiveAdapterRegisry 2018-05-18 21:32:46 -04:00
Sebastien Deleuze 2c85be333c Filter synthetic in ReflectionUtils#USER_DECLARED_METHODS
Issue: SPR-16823
2018-05-15 14:58:50 +02:00
Oleksandr Hasheniuk 6545cab42c Improve performance of StringUtils#trimWhitespace
Issue: SPR-16766
2018-05-01 11:16:34 +02:00
nkjackzhang fb0e3e9356 Fix a typo in @Nullable Javadoc 2018-04-18 11:53:09 +02:00
Juergen Hoeller 2f4010e8d3 Correctly delegate to OrderUtils.getPriority for DecoratingProxy
Issue: SPR-16739
2018-04-17 23:37:42 +02:00
Juergen Hoeller d78e27f1e9 Avoid repeated superclass introspection in findAnnotation(Method,...)
Issue: SPR-16730
2018-04-17 16:44:28 +02:00
Juergen Hoeller 51be8a7303 Workaround for generic parameter types on inner class constructors
Issue: SPR-16734
2018-04-17 14:32:54 +02:00
Juergen Hoeller 0754833b37 Local XMLUnit dependency declarations with consistent version 2.5.1 2018-04-14 21:03:20 +02:00
Juergen Hoeller b95e05db04 AspectJExpressionPointcut consistently resolves superinterface methods
Includes efficient check for same ClassLoader in ClassUtils.isVisible, efficient MethodMatchers check for IntroductionAwareMethodMatcher, and supertype method resolution in MethodMapTransactionAttributeSource.

Issue: SPR-16723
2018-04-14 15:10:05 +02:00
Juergen Hoeller 0efa7a05ad ClassUtils.isCacheSafe delegates to isVisible for resolving classes
Issue: SPR-16714
2018-04-12 20:55:26 +02:00
Juergen Hoeller 46e3a919fe Cache-safety check for sibling loaders resolving the same classes
Issue: SPR-16714
2018-04-12 18:50:32 +02:00
Andreas Asplund 6a34ca24ce Restore org.springframework.cglib.core.KeyFactoryCustomizer.class
Issue: SPR-15859
2018-04-11 15:41:40 +02:00
Juergen Hoeller da80502ea6 AnnotationUtils.getAnnotation non-null check for synthesizeAnnotation
Issue: SPR-16708
2018-04-11 12:50:27 +02:00
Juergen Hoeller 61c3db0869 MethodHandles.Lookup.defineClass for CGLIB class definition purposes
Spring's CGLIB fork is patched with local copies of affected files here, introducing the notion of a "contextClass" (e.g. the proxy superclass) which gets passed through to ReflectUtils.defineClass for delegating to MethodHandles.Lookup.defineClass eventually, against a privateLookupIn(contextClass) lookup context on JDK 9/10/11.

Issue: SPR-15859
2018-04-11 12:47:55 +02:00
Sam Brannen 8874427cf4 Clean up warnings in spring-core 2018-04-10 13:10:58 +02:00
Juergen Hoeller 5d0700b936 AnnotationUtils.annotatedInterfaceCache available as deprecated field
Issue: SPR-16675
2018-04-03 12:21:03 +02:00
Juergen Hoeller 6102715b8d Consistent treatment of proxy classes and interfaces for introspection
Issue: SPR-16675
Issue: SPR-16677
2018-04-03 02:42:41 +02:00
Juergen Hoeller cc379f1cc7 Polishing 2018-04-01 12:57:19 +02:00
Juergen Hoeller 912c270f2b Polishing 2018-03-31 17:49:21 +02:00
Juergen Hoeller 129c05bcff Comprehensively cache annotated methods for interfaces and superclasses
Issue: SPR-16675
2018-03-31 15:12:02 +02:00
Juergen Hoeller 4da27c2a73 Avoid unnecessary introspection on methods and meta-annotations
Issue: SPR-16667
2018-03-31 00:18:14 +02:00
Kazuki MATSUDA d232fffa63 Use whenComplete since (null) return value not needed 2018-03-30 11:07:46 -04:00
Juergen Hoeller 22a8a668c9 AnnotationTypeFilter assumes no custom annotations on common Java types
Issue: SPR-16667
2018-03-30 15:31:43 +02:00
Juergen Hoeller 7a8d41e5d6 Extended set of common classes and language interfaces in ClassUtils
Issue: SPR-16667
2018-03-30 13:41:22 +02:00
Sam Brannen a6c45f0cd9 Polishing 2018-03-30 11:45:28 +02:00
Juergen Hoeller d553ddc5b3 Nullability refinements (based on IntelliJ IDEA 2018.1 introspection)
Issue: SPR-15756
2018-03-29 23:50:17 +02:00
Sam Brannen 17703e5dde Polishing 2018-03-29 17:45:55 +02:00
Sam Brannen 7c28152c13 Introduce ClassUtils.isInnerClass() utility method 2018-03-29 17:45:25 +02:00
Juergen Hoeller b165475eb6 Polishing 2018-03-29 16:05:52 +02:00
Juergen Hoeller 08dad4e3ac Consistent references to primitive types (in alphabetical order) 2018-03-29 16:05:00 +02:00
Juergen Hoeller 53d01392d7 Workaround for inner class constructor parameter annotation bug in javac
Issue: SPR-16652
2018-03-29 15:45:02 +02:00
Juergen Hoeller 3ac46da22f Correct description for doWithLocalFields
Issue: SPR-16658
2018-03-29 15:42:30 +02:00
Sam Brannen 4b9e3a9211 Introduce failing test for SPR-16652
This commit introduces tests for looking up annotations on parameters
in constructors for nested and inner classes via Spring's
MethodParameter abstraction.

The test for an inner class is currently disabled since it fails on
JDK 8. See JIRA issue for details.

Issue: SPR-16652
2018-03-28 17:42:55 +02:00
Juergen Hoeller b2d87abcbb Polishing 2018-03-28 12:06:38 +02:00
Rossen Stoyanchev e00384a6fd MimeTypeUtils trims parameter names / values
Issue: SPR-16630
2018-03-27 19:56:09 -04:00
Juergen Hoeller e3d0ef6015 Use Map.forEach instead of manual Map.Entry iteration wherever possible
Issue: SPR-16646
2018-03-27 00:38:32 +02:00
Rossen Stoyanchev ab2410c754 MimeTypeUtils uses SecureRandom
The prevailing current wisdom is to use the default constructor for
secure and let it pick the best algorithm for the OS.

On Java 8 (Oracle), Linux this results in "NativePRNG" which uses
/dev/random (potentially blocking) for the initial seed, and
/dev/urandom (non-blocking) for subsequent calls to nextInt.

Issue: SPR-16635
2018-03-23 21:45:41 -04:00
Juergen Hoeller f00afe3247 Use (Concurrent)Map.computeIfAbsent for lazy nested collection creation 2018-03-23 17:36:23 +01:00