Commit Graph

2191 Commits

Author SHA1 Message Date
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