- 27 5月, 2015 3 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, when a nested array of annotations was synthesized while adapting values within an AnnotationAttributes map, the array was improperly replaced with an array of type Annotation[] instead of an array of the concrete annotation type, which can lead to unexpected run-time exceptions. This commit fixes this bug by replacing annotations in the existing array with synthesized versions of those annotations, thereby retaining the original array's component type. Issue: SPR-13077
-
由 Sam Brannen 提交于
This commit introduces support in AnnotationAttributes for retrieving nested annotations that is on par with the existing type-safe support for retrieving nested AnnotationAttributes. Issue: SPR-13074
-
由 Sam Brannen 提交于
AnnotationAttributes has existed for several years, but none of the "get" methods that make up its public API are documented. In many cases, the behavior can be inferred from the name of the method, but for some methods there are "hidden gems" and unexpected behavior lurking behind the scenes. This commit addresses this issue by documenting all public methods. In addition, the hidden support for converting single elements into single-element arrays has also been documented and tested. Issue: SPR-13072
-
- 24 5月, 2015 3 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-13066
-
由 Sam Brannen 提交于
Issue: SPR-13065
-
由 Sam Brannen 提交于
Issue: SPR-13064
-
- 23 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
-
- 22 5月, 2015 5 次提交
-
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
This commit introduces a test that will fail if SynthesizedAnnotation is not public as is required by the contract for getProxyClass() in java.lang.reflect.Proxy. Issue: SPR-13057
-
由 Juergen Hoeller 提交于
Includes an optimization for simple ByteBuffer duplication. Issue: SPR-13056
-
由 Stephane Nicoll 提交于
-
由 Sam Brannen 提交于
This commit introduces first-class support for aliases for annotation attributes. Specifically, this commit introduces a new @AliasFor annotation that can be used to declare a pair of aliased attributes within a single annotation or an alias from an attribute in a custom composed annotation to an attribute in a meta-annotation. To support @AliasFor within annotation instances, AnnotationUtils has been overhauled to "synthesize" any annotations returned by "get" and "find" searches. A SynthesizedAnnotation is an annotation that is wrapped in a JDK dynamic proxy which provides run-time support for @AliasFor semantics. SynthesizedAnnotationInvocationHandler is the actual handler behind the proxy. In addition, the contract for @AliasFor is fully validated, and an AnnotationConfigurationException is thrown in case invalid configuration is detected. For example, @ContextConfiguration from the spring-test module is now declared as follows: public @interface ContextConfiguration { @AliasFor(attribute = "locations") String[] value() default {}; @AliasFor(attribute = "value") String[] locations() default {}; // ... } The following annotations and their related support classes have been modified to use @AliasFor. - @ManagedResource - @ContextConfiguration - @ActiveProfiles - @TestExecutionListeners - @TestPropertySource - @Sql - @ControllerAdvice - @RequestMapping Similarly, support for AnnotationAttributes has been reworked to support @AliasFor as well. This allows for fine-grained control over exactly which attributes are overridden within an annotation hierarchy. In fact, it is now possible to declare an alias for the 'value' attribute of a meta-annotation. For example, given the revised declaration of @ContextConfiguration above, one can now develop a composed annotation with a custom attribute override as follows. @ContextConfiguration public @interface MyTestConfig { @AliasFor( annotation = ContextConfiguration.class, attribute = "locations" ) String[] xmlFiles(); // ... } Consequently, the following are functionally equivalent. - @MyTestConfig(xmlFiles = "test.xml") - @ContextConfiguration("test.xml") - @ContextConfiguration(locations = "test.xml"). Issue: SPR-11512, SPR-11513
-
- 19 5月, 2015 1 次提交
-
-
由 Stephane Nicoll 提交于
Remove unused imports
-
- 18 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
ByteBufferConverter also defensively returns the rewind result now. Issue: SPR-13031
-
- 15 5月, 2015 1 次提交
-
-
由 Stephane Nicoll 提交于
Provide Converter implementations for Charset, Currency and TimeZone as related PropertyEditors are available for those. Issue: SPR-13020
-
- 13 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
This commit updates the "get semantics" search algorithm used in `AnnotatedElementUtils` so that locally declared 'composed annotations' are favored over inherited annotations. Specifically, the internal `searchWithGetSemantics()` method now searches locally declared annotations before searching inherited annotations. All TODOs in `AnnotatedElementUtilsTests` have been completed, and all ignored tests have been reinstated. Issue: SPR-11598
-
- 12 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
(cherry picked from commit 9e925aa8)
-
- 10 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-13007
-
- 09 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12998
-
- 08 5月, 2015 5 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the `getAnnotation()` method in `TypeDescriptor` only supported a single level of meta-annotations. In other words, the annotation hierarchy would not be exhaustively searched. This commit provides support for arbitrary levels of meta-annotations in `TypeDescriptor` by delegating to `AnnotationUtils.findAnnotation()` within `TypeDescriptor.getAnnotation()`. Issue: SPR-12793
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
Issue: SPR-12998
-
由 Arjen Poutsma 提交于
Prior to this commit, AntPathMatcher would not correctly combine a path that ends with a separator with a path that starts with a separator. For example, `/foo/` + `/bar` combined into `/foo//bar`. Specifically, this commit: - Removes the duplicated separator in combined paths - Improves RequestMappingInfo's toString() representation - Fixes Javadoc formatting in AntPathMatcher - Polishes AntPathMatcherTests - Polishes Javadoc in AbstractRequestCondition Issue: SPR-12975
-
由 Juergen Hoeller 提交于
-
- 07 5月, 2015 4 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12003
-
由 Juergen Hoeller 提交于
Issue: SPR-12971
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
Issue: SPR-11514
-
- 06 5月, 2015 4 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-11514
-
由 Sam Brannen 提交于
Issue: SPR-11514
-
由 Sam Brannen 提交于
This commit picks up where SPR-11483 left off, with the goal of eliminating all unnecessary inspection of core JDK annotations in Spring's annotation search algorithms in AnnotatedElementUtils and AnnotationMetadataReadingVisitor. Issue: SPR-12989
-
由 Sam Brannen 提交于
- Methods which search for a specific annotation now properly ensure that the sought annotation was actually found. - Both the "get" and the "find" search algorithms no longer needlessly traverse meta-annotation hierarchies twice. - Both the "get" and the "find" search algorithms now properly increment the metaDepth when recursively searching within the meta-annotation hierarchy. - Redesigned getMetaAnnotationTypes() so that it doesn't needlessly search irrelevant annotations. - Documented and tested hasMetaAnnotationTypes(). - Documented isAnnotated(). Issue: SPR-11514
-
- 03 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
-
- 27 4月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
This commit documents the status quo for the getMetaAnnotationTypes() method in AnnotatedElementUtils and adds appropriate regression tests to AnnotatedElementUtilsTests. In addition, this commit also introduces a SimpleAnnotationProcessor base class in AnnotatedElementUtils. Issue: SPR-11514
-
- 25 4月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-12738
-
- 24 4月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
This commit introduces support for finding annotations on abstract, bridge, and interface methods in AnnotatedElementUtils. - Introduced dedicated findAnnotationAttributes() methods in AnnotatedElementUtils that provide first-class support for processing methods, class hierarchies, interfaces, bridge methods, etc. - Introduced find/get search algorithm dichotomy in AnnotatedElementUtils which is visible in the public API as well as in the internal implementation. This was necessary in order to maintain backwards compatibility with the existing API (even though it was undocumented). - Reverted all recent changes made to the "get semantics" search algorithm in AnnotatedElementUtils in order to ensure backwards compatibility, and reverted recent changes to JtaTransactionAnnotationParser and SpringTransactionAnnotationParser accordingly. - Documented internal AnnotatedElementUtils.Processor<T> interface. - Enabled failing tests and introduced findAnnotationAttributesFromBridgeMethod() test in AnnotatedElementUtilsTests. - Refactored ApplicationListenerMethodAdapter.getCondition() and enabled failing test in TransactionalEventListenerTests. - AnnotationUtils.isInterfaceWithAnnotatedMethods() is now package private. Issue: SPR-12738, SPR-11514, SPR-11598
-
- 23 4月, 2015 2 次提交
-
-
由 Sam Brannen 提交于
This commit introduces support in AnnotatedElementUtils for finding annotations declared on interfaces at the type level. NB: this commit does not include support for finding annotations declared on interface methods. In order to maintain backward compatibility with @Transactional annotation attribute processing, a new getAnnotationAttributes() method has been added to AnnotatedElementUtils that provides a flag to control whether interfaces should be searched. SpringTransactionAnnotationParser and JtaTransactionAnnotationParser have been updated accordingly to ensure that interfaces are not unintentionally searched in the @Transactional resolution process. This commit also introduces additional tests and updates TODOs for SPR-12738. Issue: SPR-12944, SPR-12738
-
由 Sam Brannen 提交于
-
- 22 4月, 2015 2 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the search algorithm used by the findAnnotation(Method, Class) method in AnnotationUtils only found direct annotations or direct meta-annotations (i.e., one level of meta-annotations). This commit reworks the search algorithm so that it supports arbitrary levels of meta-annotations on methods. To make this possible, a new findAnnotation(AnnotatedElement, Class) method has been introduced in AnnotationUtils. This fix also allows for the @Ignore'd tests in TransactionalEventListenerTests to be re-enabled. Issue: SPR-12941
-
由 Sam Brannen 提交于
-