Commit Graph

939 Commits

Author SHA1 Message Date
Sam Brannen
12e05280ad Upgrade to AssertJ 3.16 2020-05-06 15:22:23 +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
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
Sam Brannen
db45b80b1f Suppress warnings for deprecated AnnotationFilter.NONE enum constant
See gh-24932
2020-04-26 13:58:31 +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
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
Sam Brannen
376434eb75 Polishing 2020-04-19 19:17:02 +02:00
Sam Brannen
f42955c31b Polishing 2020-04-19 17:49:08 +02:00
Sam Brannen
3dadcaeb2d Polishing 2020-04-17 19:07:49 +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
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
Christoph Dreis
1c6dda3ca4 Improve performance of StringUtils#cleanPath 2020-03-23 23:25:15 +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
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
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
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
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
Sam Brannen
cf9a052e3a Polish contribution
See gh-24428
2020-02-03 15:39:00 +01:00
Hyunjin Choi
1b39f138eb Test ObjectUtils.containsElement()
This commit introduces a unit test for the containsElement() method
in ObjectUtils.

Closes gh-24428
2020-02-03 15:34:47 +01:00
Sam Brannen
d77a28aac3 Support optional command line arguments with empty values
Spring Framework provides two implementations of the
CommandLinePropertySource API: SimpleCommandLinePropertySource and
JOptCommandLinePropertySource.

Prior to this commit, JOptCommandLinePropertySource supported empty
values for optional arguments; whereas, SimpleCommandLinePropertySource
did not.

This commit modifies the implementation of SimpleCommandLinePropertySource
to allow empty values for optional arguments.

Closes gh-24464
2020-02-03 15:03:43 +01:00
Sam Brannen
daebbf1960 Polishing 2020-01-31 14:34:50 +01:00
Sam Brannen
6c2cb8ecf5 Polish contribution
See gh-24351
2020-01-14 17:33:02 +01:00
hyeonisism
f1827cb1f9 Add tests for StringUtils split() method
Closes gh-24351
2020-01-14 17:20:38 +01:00
Sam Brannen
33ffdd865d Update copyright date 2020-01-13 16:29:23 +01:00
Qimiao Chen
c84dd55863 Fix typo in ReflectionUtilsTests
Closes gh-24344
2020-01-13 16:27:05 +01:00
Rossen Stoyanchev
a741ae422b Improve limit handling in StringDecoder
The case of one data buffer containing multiple lines can could cause
a buffer leak due to a suspected issue in concatMapIterable. This
commit adds workarounds for that until the underlying issue is
addressed.

Closes gh-24339
2020-01-13 14:57:14 +00:00
Rossen Stoyanchev
01827389ef Polishing contribution
See gh-24292
2020-01-08 16:19:25 +00:00
Oleh Faizulin
e96b71acf3 contentLength support for Resource decoding
Expose the known content length, if known, in the InputStreamResource returned by ResourceHttpMessageConverter or
ResourceDecoder.

See gh-24292
2020-01-08 16:19:11 +00:00
Sam Brannen
3299793c8a Polish [Simple]AliasRegistry[Tests] 2020-01-06 11:30:05 +01:00
Sam Brannen
4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen
5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller
0711e58a5f Un-deprecate PathResource (for NIO Path resolution in createRelative)
Includes aligned createRelative signature and dedicated java.io.File test.

Closes gh-24211
2019-12-16 16:50:04 +01:00