Commit Graph

898 Commits

Author SHA1 Message Date
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
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
Sam Brannen
49ddf798e0 Polish ClassUtils.resolvePrimitiveClassName()
See gh-24192
2019-12-13 15:47:05 +01:00
Sam Brannen
2bd821c909 Improve exception for mixed explicit/implicit aliases with @AliasFor
Given the following improperly configured composed @RequestMapping
annotation:

@Retention(RetentionPolicy.RUNTIME)
@RequestMapping
@interface PostApi {

	@AliasFor("value")
	String[] path() default {};

	@AliasFor(annotation = RequestMapping.class, attribute = "path")
	String[] value() default {};
}

Prior to this commit, an attempt to process the above annotation
resulted in an exception similar to the following, which is not
especially helpful to discern the problem.

> Attribute 'value' in annotation [PostApi] must be declared as an
> @AliasFor 'path', not 'path'.

This commit improves the exception message for such scenarios,
resulting in an exception message similar to the following.

> Attribute 'value' in annotation [PostApi] must be declared as an
> @AliasFor attribute 'path' in annotation [PostApi], not attribute
> 'path' in annotation [RequestMapping].

Closes gh-24168
2019-12-10 14:36:11 +01:00
Sam Brannen
4466114cfa Polishing 2019-12-10 14:26:48 +01:00
Juergen Hoeller
2d2993dffb Cleanup of "varaible" typos in ResolvableTypeTests 2019-12-09 14:03:56 +01:00
Phillip Webb
7c84695333 Support variable resolution of wildcard types
Update `ResolvableType` so that variable referenced can be resolved
against wildcard types. Prior to this commit, given a type:

	Map<String, ? extends List<? extends CharSequence>>

Calling `type.getGeneric(1).asCollection().resolveGeneric()` would
return `null`. This was because the `List` variable `E` referenced a
wildcard type which `resolveVariable` did not support.

Closes gh-24145
2019-12-06 13:38:46 +01:00
Sam Brannen
a4fa6a7a31 Test status quo for @Inherited annotation support in AnnotationMetadata 2019-12-05 23:30:14 +01:00
Sam Brannen
3b9d1a00b0 Polishing 2019-12-05 22:37:00 +01:00
Sam Brannen
fb13f6f0bc Add integration test for gh-24110 2019-12-03 16:48:30 +01:00
wanxiangming1994
6f15f32be3 Honor default values for implicit aliases in composed annotations
Spring Framework 5.2 introduced a regression for implicit aliases
declared via @AliasFor. Specifically, Spring's merged annotation
algorithms stopped honoring default values for implicit alias pairs if
the composed annotation was used without specifying the aliased
attributes.

This commit fixes this regression.

Closes gh-24110
2019-12-03 16:14:49 +01:00
Sam Brannen
7cedffc707 Support @Inherited again in reflection-based AnnotationMetadata
Spring Framework 5.2 introduced a regression in reflection-based
AnnotationMetadata. Specifically, as of 5.2, StandardAnnotationMetadata
no longer found @Inherited annotations from superclasses.

This commit fixes this regression by switching to the INHERITED_ANNOTATIONS
SearchStrategy when creating the MergedAnnotations used within
StandardAnnotationMetadata,

Note, however, that the discrepancy between StandardAnnotationMetadata
and SimpleAnnotationMetadata (i.e., reflection-based vs. ASM-based)
regarding @Inherited support still remains as it was prior to Spring
Framework 5.2.

Closes gh-24077
2019-11-29 00:07:44 +01:00
Sam Brannen
85016aef30 Test status quo for @Inherited annotations in AnnotationMetadata
This commit introduces failing assertions that are currently disabled
via a boolean reproduceGh24077 flag.

Setting that flag to true demonstrates the regression for
StandardAnnotationMetadata and inconsistencies for SimpleAnnotationMetadata.

See gh-24077
2019-11-28 18:45:58 +01:00
Sam Brannen
d1f544209e Test status quo for AnnotatedTypeMetadata.getAnnotationAttributes()
See gh-24077
2019-11-28 13:50:35 +01:00
Juergen Hoeller
06b1f31cdd SynthesizedMergedAnnotationInvocationHandler does not pre-load values
Closes gh-24029
2019-11-19 14:54:12 +01:00