Commit Graph

2388 Commits

Author SHA1 Message Date
Sam Brannen 8a394c2b07 Merge branch '5.2.x' 2020-07-28 10:00:21 +02:00
Sam Brannen 2b3fdfabb2 Remove unused class filtering support in AnnotationScanner
PR gh-25429 brought it to our attention that there was a bug in
AnnotationScanner when using a non-null class filter that filtered out
classes; however, it turns out that there is no production code that
utilizes the package-private class filtering support.

This commit therefore removes all class filtering support from
AnnotationScanner since that functionality is effectively unused.

Closes gh-25477
2020-07-28 09:58:14 +02:00
Sam Brannen a03f894a14 Merge branch '5.2.x' 2020-07-25 15:48:53 +02:00
Sam Brannen 5442d8779a Polish contribution
See gh-25429
2020-07-25 15:24:36 +02:00
yilianhuaixiao 650cbeee14 Avoid infinite loop in AnnotationScanner
Prior to this commit, scanning for annotations resulted in an infinite
loop when using the INHERITED_ANNOTATIONS search strategy and a class
filter that filters out visited classes.

This commit avoids an infinite loop in AnnotationsScanner's
processClassInheritedAnnotations(...) method by skipping the current
level of the class hierarchy when the current source class has been
filtered out.

Closes gh-25429
2020-07-25 15:23:21 +02:00
Arjen Poutsma cf8c36adf3 Javadoc
Add Javadoc note explaining that StringUtils.cleanPath should not be
depended on in security context.
2020-07-23 17:43:20 +02:00
Sam Brannen 471577a11b Polish contribution
See gh-25454
2020-07-22 11:35:31 +02:00
XenoAmess 523d2f88be Use List.sort instead of Collection.sort in tests
Closes gh-25454
2020-07-22 11:32:50 +02:00
XenoAmess cd12583e13
Use Integer.parseInt instead of Integer.valueOf for primitive int
Closes gh-25456
2020-07-22 10:54:32 +02:00
XenoAmess c7f44ff671
Fix links in Javadoc
Closes gh-25448
2020-07-22 10:24:55 +02:00
XenoAmess e71f702bb9
Use `static private` instead of `private static` for method declarations
Closes gh-25452
2020-07-21 18:26:28 +02:00
Juergen Hoeller 198d64d539 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-07-17 17:52:08 +02:00
Juergen Hoeller 01bab89dba Consistently use PropertySource.getName() for comparison
Includes synchronization for mutators on MutablePropertySources.

Closes gh-25369
2020-07-17 17:45:58 +02:00
May 490bdd11a5 Use Math.min() in ExponentialBackOff
Use Math.min() instead of doing it manually in ExponentialBackOff.

Closes gh-25381
2020-07-13 11:53:30 +02:00
Juergen Hoeller a1bab14140 Upgrade to ASM 9.0 beta
Closes gh-24872
2020-07-07 16:17:58 +02:00
Sam Brannen 8e02d2706e Merge branch '5.2.x' 2020-07-07 14:18:56 +02:00
Sam Brannen 2c9e794676 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:17:36 +02:00
Sam Brannen 362e228142 Merge branch '5.2.x' 2020-07-03 12:04:34 +02:00
Sam Brannen 35582ded0e Use System.nanoTime() for Random seed in SocketUtils
Prior to this commit, SocketUtils used System.currentTimeMillis() for
the seed for the java.util.Random instance used internally. The use of
the milliseconds value returned by currentTimeMillis() can lead to
collisions for randomly selected free ports for tests executing in
parallel on the same computer.

This commit therefore switches to System.nanoTime() for the Random seed
used in SocketUtils in an attempt to avoid such collisions for tests
executing in parallel in different JVMs on the same computer.

Closes gh-25321
2020-07-03 12:04:02 +02:00
Rossen Stoyanchev 3aaff40e2e Replace explicit use of PooledDataBuffer.release() 2020-07-01 08:07:50 +01:00
Rossen Stoyanchev b16f6fa456 Shared static instance of DefaultDataBufferFactory 2020-06-24 16:12:56 +01:00
Juergen Hoeller 56c661829b Avoid package cycle through dedicated ResourcePropertiesPersister
See gh-25151
2020-06-23 16:54:55 +02:00
Rossen Stoyanchev f0b8e638ad Avoid dependency on netty-common in DataBufferUtils
See: gh-22594
2020-06-23 14:20:24 +01:00
Juergen Hoeller 9e12a20324 Polishing 2020-06-23 11:35:22 +02:00
izeye a678db3888 Polish
Closes gh-880
2020-06-23 09:51:45 +02:00
Sam Brannen ab0e651547 Polish SerializationTestUtils, clean up warnings, etc. 2020-06-20 18:17:03 +02:00
Sébastien Deleuze 63dff520e6 Disable and remove unsupported features from native images
This commit removes load time weaving, CGLIB and Objenesis support
from native images.

GraalDetector has been removed for now because of
https://github.com/oracle/graal/issues/2594. It should be reintroduced
when this bug will be fixed with NativeImageDetector class name.

Closes gh-25179
2020-06-20 17:05:13 +02:00
Rossen Stoyanchev 2d8b2fed8b Avoid dependency on netty-common in DataBufferUtils
See: gh-22594
2020-06-20 15:56:35 +01:00
Rossen Stoyanchev 78d1591e2d Merge branch '5.2.x' 2020-06-19 22:09:43 +01:00
Rossen Stoyanchev f35903f23d Catch IllegalReferenceCountException
Closes gh-22594
2020-06-19 21:58:03 +01:00
Sébastien Deleuze 1e501f2583 Provide a flag to disable XML support
This commit introduces a spring.xml.ignore system property
which when set to true avoid initializing XML infrastructure.

A typical use case is optimizing GraalVM native image footprint
for applications not using XML. In order to be effective, those
classes should be initialized at build time:

- org.springframework.util.DefaultPropertiesPersister
- org.springframework.core.io.support.PropertiesLoaderUtils
- org.springframework.web.servlet.function.support.RouterFunctionMapping
- org.springframework.web.client.RestTemplate
- org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver
- org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
- org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
- org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter
- org.springframework.http.codec.support.BaseDefaultCodecs
- org.springframework.beans.PropertyEditorRegistrySupport

Closes gh-25151
2020-06-19 09:42:12 +02:00
Juergen Hoeller 6ea7ff1c6d Upgrade to ASM master (8.1 beta)
Closes gh-24872
2020-06-17 10:56:40 +02:00
Сергей Цыпанов 7949937655 Remove redundant assignment of default values to volatile fields 2020-06-17 10:50:51 +02:00
Sam Brannen 8099fc8178 Use try-with-resources language construct where feasible
Closes gh-2063

Co-authored-by: igor-suhorukov <igor.suhorukov@gmail.com>
2020-06-16 22:57:45 +02:00
Sam Brannen 94d7462891 Ensure spring-core JAR is reproducible
Prior to this commit, a change to Javadoc in any class in spring-core
would result in ALL tests in the entire test suite being re-run via the
Gradle build.

Thanks to a tip from @melix, this commit aims to ensure that the
spring-core JAR is "reproducible".
2020-06-13 14:53:06 +02:00
Sam Brannen 3f7e86eadd Update Javadoc for Assert regarding Guava Preconditions 2020-06-13 14:53:06 +02:00
Sam Brannen 50a0094a47 Ensure spring-core JAR is reproducible
Prior to this commit, a change to Javadoc in any class in spring-core
would result in ALL tests in the entire test suite being re-run via the
Gradle build.

Thanks to a tip from @melix, this commit ensures that the spring-core
JAR is "reproducible".
2020-06-13 14:36:27 +02:00
Sam Brannen d9969d1e4d Update Javadoc for Assert regarding Guava Preconditions 2020-06-12 09:49:47 +02:00
Roland Weisleder f9cca5d9d6
Add tests for Assert.noNullElements(Collection, ...)
Commit 4000b244ff introduced new variants for noNullElements in
org.springframework.util.Assert.

This commit adds the corresponding tests to AssertTests.

Closes gh-25239
2020-06-12 09:37:25 +02:00
Sam Brannen bc4945d677 Ensure non-null condition comes 1st in ternary operator
See gh-25232
2020-06-11 15:11:48 +02:00
GardenLee e866fac8e7 Wrap ternary operator within parentheses as outlined in Code Style
Closes gh-25232
2020-06-11 15:11:48 +02:00
Juergen Hoeller 663f2e8afd Merge branch '5.2.x' 2020-06-10 22:53:06 +02:00
Juergen Hoeller ae1ed9d458 Document exception handling limitations in TaskDecorator implementations
Closes gh-25231
2020-06-10 22:52:01 +02:00
Rossen Stoyanchev 1984cfe9d7 Merge branch '5.2.x' 2020-06-08 21:20:44 +01:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01:00
Juergen Hoeller 65b09be669 Polishing 2020-06-06 16:10:20 +02:00
Sam Brannen da7ead8914 Polishing 2020-06-03 15:05:58 +02:00
Juergen Hoeller e955e52f2f Refactor method name dispatching to switch statements
Closes gh-25163
2020-05-29 23:07:25 +02:00
Juergen Hoeller 42ff01b5aa Merge branch '5.2.x' 2020-05-29 15:57:32 +02:00
Juergen Hoeller 914425eefa Polishing 2020-05-29 15:52:39 +02:00
Juergen Hoeller ef626e992d Document that MapPropertySource should not contain null values
Closes gh-25142
2020-05-29 15:49:36 +02:00
Juergen Hoeller bec89dba4c 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 15:48:19 +02:00
Juergen Hoeller 27d5fdc5aa Polishing 2020-05-26 23:35:38 +02:00
Sam Brannen a853a58c62 Avoid duplicate addition of void.class in ClassUtils
This commit avoids duplicate addition of void.class to the temporary
primitiveTypes Set in the static initialization block in ClassUtils.

Closes gh-25128
2020-05-26 11:19:33 +02:00
Juergen Hoeller 399453d9f1 Merge branch '5.2.x'
# Conflicts:
#	spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
#	spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
2020-05-22 17:16:09 +02:00
Juergen Hoeller d7161f5e5e Polishing 2020-05-22 16:23:46 +02:00
Juergen Hoeller e5c079edfc Introduce serializeToByteArray/deserializeFromByteArray on (De)Serializer
Closes gh-25117
2020-05-22 16:22:59 +02:00
Brian Clozel 212bb7fef6 Add GenericConversionService JMH benchmark
This commit removes some of the deprecated "PERFORMANCE" tests and turns
them into JMH benchmarks.

See gh-24830
2020-05-15 22:46:05 +02:00
Brian Clozel 567265123b Avoid using regex matching for static patterns
Prior to this commit (and the previous one), the `AntPathStringMatcher`
(inner class of `AntPathmatcher`) would compile `Pattern` instances and
use regex matching even for static patterns such as `"/home"`.

This change introduces a shortcut in the string matcher algorithm to
skip the `Pattern` creation and uses `String` equality instead.
Static patterns are quite common in applications and this change can
bring performance improvements, depending on the mix of patterns
configured in the web application.

In benchmarks (added with this commit), we're seeing +20% throughput
and -40% allocation. This of course can vary depending on the number of
static patterns configured in the application.

Closes gh-24887
2020-05-15 17:07:58 +02:00
Vlad Kisel 9bfe410a0c Avoid using regex for URL matching when possible
See gh-24887
2020-05-15 17:06:58 +02:00
Juergen Hoeller 26c205589b Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
#	spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java
2020-05-14 00:33:37 +02:00
Juergen Hoeller fe33822fa7 Polishing 2020-05-14 00:23:20 +02:00
Juergen Hoeller 8212aaf3bb ResolvableType ignores TypeNotPresentException from generic signature
Closes gh-25064
2020-05-14 00:22:58 +02:00
Brian Clozel 612a63c0f1 Optimize MediaType parsing
Prior to this commit, `MediaType.parseMediaType` would already rely on
the internal LRU cache in `MimeTypeUtils` for better performance. With
that optimization, the parsing of raw media types is skipped for cached
elements.
But still, `MediaType.parseMediaType` would first get a cached
`MimeType` instance from that cache and then instantiate a
`new MediaType(type, subtype, parameters)`. This constructor not only
replays the `MimeType` checks on type/subtyme tokens and parameters, but
it also performs `MediaType`-specific checks on parameters.
Such checks are not required, as we're using an existing `MimeType`
instance in the first place.

This commit adds a new protected copy constructor (skipping checks) in
`MimeType` and uses it in `MediaType.parseMediaType` as a result.

This yields interesting performance improvements, with +400% throughput
and -40% allocation/call in benchmarks. This commit also introduces a
new JMH benchmark for future optimization work.

Closes gh-24769
2020-05-13 21:36:06 +02:00
Rossen Stoyanchev a64e7091e0 Deprecate support for RxJava 1.x
Closes gh-19628
2020-05-11 08:48:48 +01:00
Rossen Stoyanchev 7f59381c7d Add support for RxJava 3
Closes gh-24170
2020-05-11 08:48:48 +01:00
Sam Brannen 12e05280ad Upgrade to AssertJ 3.16 2020-05-06 15:22:23 +02:00
Sam Brannen b1c1a232ca Upgrade to Gradle 6.4
Closes gh-25020
2020-05-06 14:25:41 +02:00
Rossen Stoyanchev a7c736915a Polishing and completing contribution
See gh-24866
2020-05-05 18:20:45 +01:00
Vlad Kisel 3543e47841 Add ByteBufEncoder and ByteBufDecoder
See gh-24866
2020-05-05 18:20:45 +01:00
Rossen Stoyanchev 153690e717 Merge branch '5.2.x' 2020-05-04 10:55:25 +01:00
Rossen Stoyanchev c2cce0c547 Add isDeferred to ReactiveTypeDescriptor
Closes gh-24995
2020-05-01 15:39:52 +01:00
Sam Brannen 859953fe81 Use same default ClassLoader in SpringFactoriesLoader
Prior to this commit, the loadFactoryNames() and loadFactories() methods
in SpringFactoriesLoader effectively used a different default
ClassLoader.

This commit ensures that the ClassLoader for SpringFactoriesLoader.class
is now consistently used as the default ClassLoader.

Closes gh-24992
2020-04-29 14:46:02 +02:00
Sam Brannen 5abca033d0 Revise duplicate filtering in SpringFactoriesLoader
This commit ensures that the static cache in SpringFactoriesLoader
contains unmodifiable lists of unique names of factory implementations.

See gh-24985
2020-04-29 14:05:14 +02:00
Sam Brannen 4e32615b22 Filter out duplicates in SpringFactoriesLoader
Prior to this commit, SpringFactoriesLoader discovered all registered
factory implementations for a given factory type even if duplicates
were registered within a single META-INF/spring.factories file or in
multiple such files in the classpath.

This commit updates the internals of SpringFactoriesLoader so that
duplicate registrations are ignored, thereby aligning with the
well-known semantics for java.util.ServiceLoader in this regard.

Closes gh-24985
2020-04-28 16:44:18 +02:00
Sam Brannen afc398333e Polishing 2020-04-28 16:34:58 +02:00
Jendrik Johannes 9bd60f6554 Update to Gradle 6.2
- Build Scan plugin is now Gradle Enterprise plugin applied in settings
- Compile task dependencies are now defined through classpath
- Test fixture publication can be disabled through public API

Closes gh-24384
2020-04-28 15:03:03 +02:00
Juergen Hoeller cdadb834b0 Redefine DefaultResourceLoader default constructor for late TCCL access
Closes gh-24957
2020-04-28 13:02:39 +02:00
Juergen Hoeller 73fadd8b7c Polishing 2020-04-27 11:45:41 +02:00
Sam Brannen 59ecd4997c Optimize toString() for synthesized annotations
This commit moves the toString() implementation for synthesized
annotations from TypeMappedAnnotation to
SynthesizedMergedAnnotationInvocationHandler in order to take advantage
of the synthesized annotation attribute value cache introduced in
72b1abd226.

Closes gh-24970
2020-04-26 14:14:07 +02:00
Sam Brannen db45b80b1f Suppress warnings for deprecated AnnotationFilter.NONE enum constant
See gh-24932
2020-04-26 13:58:31 +02:00
Juergen Hoeller ad088f2157 Polishing 2020-04-25 17:59:04 +02:00
Juergen Hoeller af65b1ca62 Polishing 2020-04-25 16:37:16 +02:00
Juergen Hoeller e5a292fb34 Deprecate AnnotationFilter.NONE and document MergedAnnotations design
Closes gh-24932
2020-04-25 16:36:44 +02:00
Сергей Цыпанов bff1a1932f Rid pointless wrapping with BufferedInputStream from class reading 2020-04-25 16:27:01 +02:00
Sam Brannen 72b1abd226 Reintroduce synthesized annotation attribute value caching
Prior to the introduction of the MergedAnnotation API in Spring Framework
5.2, our SynthesizedAnnotationInvocationHandler utilized a cache for
annotation attribute values; whereas, the new
SynthesizedMergedAnnotationInvocationHandler has no such caching in
place.

Issues such as gh-24961 indicate a regression in performance caused by
the lack of such an attribute value cache. For example, the required
attribute in @RequestParam is looked up using the internal meta-model
in the MergedAnnotation API twice per request for each @RequestParam in
a given controller handler method.

This commit reintroduces the attribute value cache to avoid the
unnecessary performance overhead associated with multiple lookups of
the same attribute in a synthesized annotation. This applies not only
to direct attribute method invocations but also to invocations of
equals() and hashCode() on a synthesized annotation.

Note, however, that this commit does NOT address multiple lookups of
annotation attribute values for invocations of toString(). That behavior
currently remains unchanged in the implementation of
org.springframework.core.annotation.TypeMappedAnnotation.toString().

Closes gh-24970
2020-04-25 15:28:09 +02:00
Sam Brannen 8265db0ae1 Avoid synthesizing annotations unnecessarily
Commit 31fa1569c5 introduced initial support for avoiding unnecessary
annotation synthesis in the MergedAnnotation API; however, it only
avoided synthesis for annotations that do not declare any attributes.

This commit reworks this support to avoid unnecessary annotation
synthesis for annotations that declare attributes.

Specifically, this commit introduces a new `isSynthesizable()` method
in AnnotationTypeMapping that allows the "synthesizable" flag to be
computed once and cached along with the other metadata already cached
in AnnotationTypeMapping instances. TypeMappedAnnotation now delegates
to this new method when determining whether it should synthesize an
annotation.

Closes gh-24861
2020-04-23 19:09:30 +02:00
Sam Brannen a9cc7b3edc Improve tests for synthesized array of annotations 2020-04-22 15:17:33 +02:00
Sam Brannen 5721c747b2 Polishing 2020-04-21 18:47:28 +02:00
Sam Brannen 31fa1569c5 Avoid synthesizing annotations unnecessarily
Prior to Spring Framework 5.2, some of our annotation utilities would
not synthesize an annotation if it was already synthesized or not
synthesizable (i.e., did not declare local aliases via @AliasFor and
did not declare attributes that could override attributes in the
meta-annotation hierarchy above the given annotation); however, we lost
most of this functionality with the introduction of the new
MergedAnnotations API.

This commit revises the implementation of createSynthesized() in
TypeMappedAnnotation so that, for invocations of
MergedAnnotation.synthesize() and indirectly for invocations of
AnnotatedElementUtils.findMergedAnnotation(), etc.:

1. An annotation that was previously synthesized will not be
   synthesized again.

2. An annotation that is not "synthesizable" will not be synthesized.

For both of the above use cases, the original annotation is now
returned from createSynthesized().

Closes gh-24861
2020-04-21 13:31:06 +02:00
Rossen Stoyanchev 4b85b44bbd Update Javadoc of InputStreamResource#contentLength
Closes gh-20990
2020-04-20 12:53:42 +01:00
Sébastien Deleuze 6d5080825c Remove potentially confusing kotlin-reflect related log message
Closes gh-24935
2020-04-20 11:00:29 +02:00
Sam Brannen 376434eb75 Polishing 2020-04-19 19:17:02 +02:00
Sam Brannen f42955c31b Polishing 2020-04-19 17:49:08 +02:00
Mikael d6c9c7d642
Simplify substring() usage in MimeTypeUtils
Closes gh-24933
2020-04-19 17:39:06 +02:00
Sam Brannen 3dadcaeb2d Polishing 2020-04-17 19:07:49 +02:00
Johnny Lim 87fa2c3b97
Avoid unnecessary String instantiation in StringUtils.deleteAny()
This commit avoids unnecessary String instantiation in
StringUtils.deleteAny() if nothing was deleted from the
input string.

Closes gh-24924
2020-04-17 18:44:16 +02:00
Brian Clozel 39536acf9f Fix potential leak in MimeTypeUtils LRUCache
Prior to this commit, the `MimeTypeUtils` LRUCache would maintain a
queue to track least recently used cached values. In some cases,
concurrent access could create more entries in that unbounded queue than
expected and spend a significant amount of time removing entries in that
queue (i.e. iterating over a long list of elements).

This commit ensures that recently used entries are only added to the
queue if they've been removed by the current thread, in case of
concurrent access.

Fixes gh-24886
2020-04-09 15:38:01 +02:00
Сергей Цыпанов e1951a098b Improve performance of StringUtils.deleteAny() 2020-04-09 11:36:32 +02:00
Sam Brannen 8c0aaf4863 Delete meaningless "performance" test
The test deleted in this commit didn't even assert anything to begin
with.

See gh-24830
2020-04-08 15:21:32 +02:00
Juergen Hoeller 8595f01e44 Polishing 2020-04-03 21:08:45 +02:00
Moran Avigdor 7d5e474e0d Recursively copy directory with symbolic link
The following modification will also recursively traverse the directory that the symbolic link points to.
This modification is not proposed for deleteRecursively, since it can be harmful if not intended.

This modification relates to the following commit:
Consistent use of NIO.2 for file read/write interactions
Issue: SPR-15748
12114a9
2020-04-03 21:05:26 +02:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Sam Brannen ee42e3e730 Polish StreamUtils 2020-03-30 13:57:09 +02:00
Sam Brannen 9e30620ac2 Polish contribution
See gh-24805
2020-03-30 13:47:00 +02:00
Сергей Цыпанов e63d1cf12d Improve usage of ByteArrayOutputStream/ByteArrayInputStream
Closes gh-24805
2020-03-30 13:22:21 +02:00
Qimiao Chen f8ff4e42b9
Use try-with-resource to close resources
Closes gh-24807
2020-03-30 12:05:29 +02:00
Qimiao Chen 7c831d2ef4
Replace anonymous inner classes with lambdas in tests
Closes gh-24808
2020-03-30 12:02:23 +02:00
Rossen Stoyanchev 3175f0771e Remove dumpString from DataBufferTestUtils
See gh-24786
2020-03-26 21:42:12 +00:00
Rossen Stoyanchev 7aa06b8610 Polishing contribution
See gh-24786
2020-03-26 21:42:12 +00:00
Сергей Цыпанов f17b0125ff Simplify conversion of DataBuffer to String
See gh-24786
2020-03-26 21:42:12 +00:00
Juergen Hoeller 593a2ade91 Expose context class for interface-based CGLIB proxies as well
Closes gh-24657
2020-03-26 17:30:37 +01:00
Sam Brannen 6222efc54b Polish contribution
See gh-24785
2020-03-26 16:52:24 +01:00
Сергей Цыпанов 65aa2d03f0 Simplify conversion of ByteArrayOutputStream to String
Closes gh-24785
2020-03-26 16:52:14 +01:00
Brian Clozel d97eabba2f Do not cache multipart MIME types in cache
Prior to this commmit, "mutipart/*" MIME types would be cached by the
`MimeTypeUtils` LRU cache. Since those MIME types are likely to have
random boundaries in them, they can waste space in the LRU cache.
This is not improving things since we're parsing them anyway.

This commit skips the caching step for all "multipart" MIME types.

Fixes gh-24767
2020-03-24 10:59:05 +01:00
Juergen Hoeller 2209e7cb92 Reuse empty class array constant in ClassUtils
Closes gh-24221
2020-03-24 00:08:43 +01:00
Christoph Dreis 1c6dda3ca4 Improve performance of StringUtils#cleanPath 2020-03-23 23:25:15 +01:00
Juergen Hoeller 2e23cf32ce Clarify name generation responsibility for PropertySourceFactory impls
Closes gh-24757
2020-03-23 18:02:05 +01:00
Juergen Hoeller 10d47d4d21 Enable ASM8_EXPERIMENTAL for Java 14 record support
Closes gh-24722
2020-03-23 18:00:59 +01:00
Brian Clozel 831a95154e Polish ConcurrentLruCache
This commit improves the performance of the `ConcurrentLruCache` and
applies a consistent style to the code:

* separating read/write locks into different variables does not help
performance, so this change is reverted
* apply a consistent style for read/write locks and try/cactch calls
* the reordering of recently used keys is only done when the cache is
full

Fixes gh-24671
2020-03-22 21:49:07 +01:00
Kwangyong Kim 713a112812 Improve ConcurrentLruCache performance
- manage collection size manually
- check cache hit first before size check
- reduce read-lock scope
- use `map.get` to test cache instead of `queue.remove`

Closes gh-24469
See gh-24671
2020-03-22 21:48:55 +01:00
Qimiao Chen 09b36380cd
Fix typos in source files
Closes gh-24746
2020-03-20 20:06:52 +01:00
Sam Brannen 116a256e81 Fix typos in AnnotationsScannerTests 2020-03-20 15:03:01 +01:00
Qimiao Chen 2c5781473c
Improve Javadoc in AnnotatedElementUtils
Closes gh-24740
2020-03-20 15:00:17 +01:00
Qimiao Chen d85a6c0bea
Fix typos in MergedAnnotationsCollectionTests
Closes gh-24701
2020-03-15 11:48:29 +01:00
陈其苗 c5b8406def Add some test cases in StringUtilsTests 2020-03-13 12:35:04 +00:00
陈其苗 6013591fac Polish containsAny of CollectionUtils by reusing findFirstMatch 2020-03-13 12:32:43 +00:00
Juergen Hoeller 7f26e8cfc6 Short-circuit interface visibility check in case of same ClassLoader
Closes gh-24664
2020-03-11 14:55:08 +01:00
Sam Brannen 787b09b202 Relax GraalVM check in DefaultParameterNameDiscoverer
Prior to this commit, DefaultParameterNameDiscoverer did not register
any discovers when compiling or running as a GraalVM native image.

This commit relaxes the GraalVM check so that it is only applied to the
registration of KotlinReflectionParameterNameDiscoverer.

Consequently, StandardReflectionParameterNameDiscoverer and
LocalVariableTableParameterNameDiscoverer are once again always
registered by DefaultParameterNameDiscoverer.

Closes gh-24600
2020-02-26 14:18:56 +01:00
Rossen Stoyanchev 2f12351292 Refine BlockHound support
- disable for Java 14/15 for now until BlockHound support
- targeted installation of required integrations only
2020-02-25 10:07:29 +00:00
Rossen Stoyanchev 2ae91404d1 BlockHoundIntegration for spring-core 2020-02-24 17:19:32 +00:00
Sam Brannen 7778508e69 Fix typos in ResolvableTypeTests
See gh-24529

Co-authored-by: Qimiao Chen <chenqimiao1994@126.com>
2020-02-24 15:37:42 +01:00
Sam Brannen d1a6e49475 Reset SecurityManager in finally-block and polish 2020-02-23 18:33:56 +01:00
Sam Brannen 809ed9d469 Rename PropertyResolverExtensionsTests to Kotlin* 2020-02-23 18:21:53 +01:00
Qimiao Chen f78c21e40b
Fix typos in tests
Closes gh-24566
2020-02-22 18:32:02 +01:00
Sam Brannen 8ff1ac59e0 Polishing 2020-02-19 11:29:51 +01:00
Rossen Stoyanchev 87f866b688 Update DigestUtils Javadoc with regards to InputStream
Closes gh-24534
2020-02-18 19:56:25 +00:00
Sam Brannen 5d4f1d9e09 Extract ValueExtractor functional interface
See gh-24375
2020-02-12 10:49:36 +01:00
Sam Brannen 974cacac31 Support nested annotations in ASM-based processing again
Spring Framework 5.0 introduced a regression in ASM-based annotation
processing. Specifically, nested annotations were no longer supported,
and component scanning resulted in an exception if a candidate
component was annotated with an annotation that contained nested
annotations.

This commit fixes this regression by introducing special handling in
AnnotationTypeMapping that supports extracting values from objects of
type TypeMappedAnnotation when necessary.

Closes gh-24375
2020-02-12 10:36:54 +01:00
Rossen Stoyanchev d552105516 Eliminate windowUntil from StringDecoder
This is a follow-up on the earlier commit
28a95e89f3 eliminating windowUntil
entirely which generates a BubblingException wrapper. This also keeps
the chain a little simpler.

See gh-24355
2020-02-11 16:49:21 +00:00
Rossen Stoyanchev 28a95e89f3 Upgrade to Dysprosium SR5 snapshots
See gh-24355
2020-02-11 12:52:04 +00:00
Rossen Stoyanchev 7d1d989535 Minor polishing in ConcurrentReferenceHashMap
Closes gh-24494
2020-02-11 10:49:28 +00:00
Rossen Stoyanchev e4a530efac Minor refactoring in CommonsLogWriter
Closes gh-24495
2020-02-11 10:40:24 +00:00
Rossen Stoyanchev df706f4c7c Restore use of Flux-based encode method in HTTP
Closes gh-24441
2020-02-07 21:44:44 +00:00
Sam Brannen 2b6117c0c2 Fix Checkstyle violation
See gh-24393
2020-02-04 13:45:02 +01:00
Sam Brannen 72685b1d81 Polish contribution
See gh-24393
2020-02-04 13:41:31 +01:00
Hyunjin Choi d624dc084f
Add close() method in FileCopyUtils to reduce duplication
Closes gh-24393
2020-02-04 13:36:24 +01:00
Hyunjin Choi 550f13e8ed
Simplify GenericConversionService.getMatchableConverters()
Closes gh-24403
2020-02-04 12:59:57 +01:00
Rossen Stoyanchev f5df422de9 Polishing contribution
See gh-24470
2020-02-03 20:32:36 +00:00
Hyunjin Choi 273812f9c5 Remove unnecessary escapes in regular expressions
See gh-24470
2020-02-03 20:22:40 +00:00