Commit Graph

18143 Commits

Author SHA1 Message Date
www
4517f40f57 Remove redundant 'String.substring()' call 2019-03-25 09:34:29 +01:00
Stephane Nicoll
80c48648d7 Merge pull request #22649 from ttddyy
* pr/22649:
  Fix typo on MergedAnnotations
2019-03-25 09:25:32 +01:00
Tadaya Tsuyukubo
860ec44c50 Fix typo on MergedAnnotations
Closes gh-22649
2019-03-25 09:25:16 +01:00
Sam Brannen
3a0f309e2c Update readme.txt in distributed artifacts 2019-03-23 19:43:34 +01:00
Sam Brannen
d41c4522da Remove italics from XML examples in Reference Manual 2019-03-23 19:32:01 +01:00
Sam Brannen
4f619787ad Revert change from URL Cleanup 2019-03-23 19:20:40 +01:00
Sam Brannen
57ab877f0d Upgrade to Gradle 5.3
Closes gh-22347
2019-03-23 18:04:44 +01:00
Sam Brannen
cd19170ffb Polish BeanUtilsTests 2019-03-23 16:19:42 +01:00
Min-soo
670aa4b7ef Use JUnit 4's expected exception support in BeanUtilsTests
This commit uses JUnit 4's built-in expected exception support in
BeanUtilsTests,

Closes gh-22354
2019-03-23 16:15:07 +01:00
Sam Brannen
9ac2e034e7 Polishing 2019-03-23 16:09:47 +01:00
Johnny Lim
14b1a6fdcb Polish docs (#22645) 2019-03-23 15:48:47 +01:00
Sam Brannen
7bb66c4f49 Replace bit.ly links with real links 2019-03-23 13:54:40 +01:00
Sam Brannen
0c8b473cac Wikipedia -> Wiki 2019-03-23 13:44:59 +01:00
Sam Brannen
9b7215e640 URL Cleanup - update remaining license headers
See gh-22617 gh-22622 gh-22635
2019-03-23 13:11:10 +01:00
Sam Brannen
20764685ec Merge URL Cleanup PRs
This merges the URL Cleanup PRs along with fixes.

Closes gh-22617 gh-22622 gh-22635
2019-03-23 13:01:57 +01:00
Sam Brannen
8a61c56154 URL Cleanup - upgrade to more modern Xalan namespace
See gh-22617 gh-22622 gh-22635
2019-03-23 12:21:21 +01:00
Juergen Hoeller
bddba68549 Polishing 2019-03-23 12:14:35 +01:00
Juergen Hoeller
32b46866c7 Make MultipartResolutionDelegate final (aligned with other delegates) 2019-03-23 12:14:21 +01:00
Juergen Hoeller
62e5585c2e Avoid package cycle between beans.factory.annotation and b.f.support
See gh-2060
2019-03-23 12:14:03 +01:00
Juergen Hoeller
5e15338a09 Nullability refinements (no IntelliJ warnings, fewer null checks)
Includes consistent ignoring of all java.lang (meta-)annotations.

Closes gh-22586
2019-03-23 12:13:38 +01:00
Sam Brannen
68837ebb57 URL Cleanup - fix undesirable code change
Namespace handlers are mapped based on the canonical names for XML
namespaces which in Spring do not use "https" as the scheme.

See gh-22617 gh-22622 gh-22635
2019-03-23 11:56:31 +01:00
Sam Brannen
307a74835d URL Cleanup - remove obsolete ATOM schema location
See gh-22617 gh-22622 gh-22635
2019-03-23 11:54:49 +01:00
Sam Brannen
2db36c00e7 URL Cleanup - use HTTPS where possible in links in Testing Chapter
See gh-22617 gh-22622 gh-22635
2019-03-23 11:54:11 +01:00
Sam Brannen
6164664f65 URL Cleanup - fix XSD imports
See gh-22617 gh-22622 gh-22635
2019-03-23 11:53:24 +01:00
Sam Brannen
cedcd2fddd URL Cleanup - fix links
See gh-22617 gh-22622 gh-22635
2019-03-23 11:52:49 +01:00
Phillip Webb
75b52309a7 Migrate CommonAnnotationBeanPostProcessor to MergedAnnotations
Closes gh-22585
2019-03-22 20:40:05 +01:00
Phillip Webb
50c257794f Migrate DefaultListableBeanFactory to MergedAnnotations
Closes gh-22584
2019-03-22 20:40:05 +01:00
Phillip Webb
857371ba67 Migrate AutowiredAnnotationBeanPostProcessor to MergedAnnotations
Closes gh-22582
2019-03-22 20:40:05 +01:00
Phillip Webb
f065abac93 Migrate AnnotationAwareOrderComparator to MergedAnnotations
Closes gh-22581
2019-03-22 20:40:05 +01:00
Phillip Webb
7244c9aea1 Add more aggressive annotation element filtering
Refine the element filtering performed by `AnnotationsScanner` to also
cover `org.springframework.util` and most `com.sun` classes which turn
out to be referenced quite frequently and which we know contain no
useful annotations.

See gh-21697
2019-03-22 20:40:05 +01:00
Phillip Webb
db8eaec131 Cache BridgeMethodResolver results
Add a cache to `BridgeMethodResolver` to help with repeated calls to
resolve the same methods. Since bridge method resolution can be somewhat
expensive (especially when resolving generics), and the number of bridge
methods is quite small, a cache generally helps.

This commit also simplifies the code a little by calling `doWithMethods`
directly rather than relying on `ReflectionUtils.getAllDeclaredMethods`
to do so. The methods list is now always created, but we save the list
creation that `getAllDeclaredMethods` used to do.

Closes gh-22579
2019-03-22 20:40:05 +01:00
Phillip Webb
a57d6ba5f3 Optimize StringUtils.cleanPath
Add an early exit to `StringUtils.cleanPath` to save array creating and
string concatenation. With a typical Spring application, the `cleanPath`
method can be called over 600 times, often with a path constructed by
a `ClassPathResource` that is likely to already be clean.

Closes gh-22568
2019-03-22 20:40:05 +01:00
Phillip Webb
19fb697d03 Add more empty array constants in ReflectionUtils
Add some additional empty array constants to `ReflectionUtils` to save
us creating new arrays for zero length results.

See gh-22567
2019-03-22 20:40:05 +01:00
Phillip Webb
e3a86be122 Make ConcurrentReferenceHashMap more JIT friendly
Update `ConcurrentReferenceHashMap` to make some methods more inline
friendly, and to manually inline a few others. These minor optimizations
don't make a great deal of difference for most applications, but seem
worthwhile since we use `ConcurrentReferenceHashMap` for many internal
caches.

Closes gh-22566
2019-03-22 20:40:05 +01:00
Phillip Webb
aa4e56b251 Optimize @Configuration class parsing a little
Update `ConfigurationClassParser` to skip `java.lang.annotation` types
which were often processed but would never provide useful results. Also
use a single shared immutable `SourceClass` instance to represent
`Object.class`.

Closes gh-22563
2019-03-22 20:40:05 +01:00
Phillip Webb
37255afca4 Complete migration of annotation utility methods
Delete `InternalAnnotationUtils` and `InternalAnnotatedElementUtils` and
migrate exclusively to the new `MergedAnnotations` API.

Closes gh-22562
2019-03-22 20:40:05 +01:00
Phillip Webb
a14bfe9a21 Migrate and verify annotation utility methods
Migrate all possible `AnnotationUtils` and `AnnotatedElementUtils`
method to the `MergedAnnotation` API, verify results against the old
implementations.

All migrated methods now call both the new API and the old version and
ensure that the same results or exceptions are raised. A full build of
both Spring Framework and Spring Boot has been executed to ensure, as
much as possible, that the migration does not cause unexpected
regressions.

See gh-22562
2019-03-22 20:40:05 +01:00
Phillip Webb
b91ccf038f Start migration annotation utility methods
Create internal variants of the existing `AnnotationUtils` and
`AnnotatedElementUtils` classes and migrate the existing classes to
use them.

The internal variants will be used to check that the same results are
given as we migrate the utils methods to use the new `MergedAnnotations`
API.

See gh-22562
2019-03-22 20:40:05 +01:00
Phillip Webb
4972d85ae0 Create a new API for handling merged annotations
Add new `MergedAnnotations` and `MergedAnnotation` interfaces that
attempt to provide a uniform way for dealing with merged annotations.

Specifically, the new API provides alternatives for the static methods
in `AnnotationUtils` and `AnnotatedElementUtils` and supports Spring's
comprehensive annotation attribute `@AliasFor` features. The interfaces
also open the possibility of the same API being exposed from the
`AnnotationMetadata` interface.

Additional utility classes for collecting, filtering and selecting
annotations have also been added.

Typical usage for the new API would be something like:

	MergedAnnotations.from(Example.class)
		.stream(MyAnnotation.class)
		.map(a -> a.getString("value"))
		.forEach(System.out::println);

Closes gh-21697
2019-03-22 20:40:05 +01:00
Phillip Webb
fdacda8b01 Add AnnotationIntrospectionFailureTests
Add a new test class to help cover annotation introspection failure
handling. These tests were previously missing and are important to
ensure that annotation util code changes don't introduce regressions.

See gh-21697
2019-03-22 20:40:05 +01:00
Phillip Webb
8ef609a1b7 Add public variant getDeclaredMethods method
Add a public variant of `getDeclaredMethods` that defensively copies the
cached methods array. This is often more faster and more convenient
for users than calling `doWithLocalMethods`. We still retain most of the
benefits of the cache, namely fewer security manager calls and not as
many `Method` instances being created.

Closes gh-22580
2019-03-22 20:40:05 +01:00
Phillip Webb
5044ee8fe6 Add AssertJ dependency for tests usage
Add AssertJ as a test scope dependency for all sub-projects.

Closes gh-22561
2019-03-22 20:40:05 +01:00
Phillip Webb
ecbad874bf Refine eclipse settings 2019-03-22 20:40:05 +01:00
Phillip Webb
9c92b21af8 Polishing 2019-03-22 20:40:05 +01:00
Rossen Stoyanchev
f8121515bf Merge branch '5.1.x' 2019-03-22 14:50:51 -04:00
Rossen Stoyanchev
c9a86e1ff4 Polish
See gh-22598
2019-03-22 14:39:21 -04:00
wenqi.huang
d10174a3e9 Optimize performance of produces condition checks 2019-03-22 13:59:34 -04:00
Sam Brannen
7fe12cc23e URL Cleanup
This merges the URL Cleanup PRs along with fixes.

Closes gh-22617 gh-22622 gh-22635
2019-03-22 16:37:36 +01:00
Sam Brannen
14902e1744 Polish Javadoc 2019-03-22 13:32:24 +01:00
arman simonyan
517812d30a Fix grammar issue 2019-03-22 09:25:21 +01:00