- 24 5月, 2015 4 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-11512
-
由 Sam Brannen 提交于
Issue: SPR-11512
-
由 Sam Brannen 提交于
This commit also introduces a cache for attribute alias metadata. Issue: SPR-11512
-
由 Sam Brannen 提交于
Issue: SPR-13064
-
- 23 5月, 2015 3 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-11512
-
由 Sam Brannen 提交于
Issue: SPR-11512
-
由 Sam Brannen 提交于
-
- 22 5月, 2015 1 次提交
-
-
由 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
-
- 20 5月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12926
-
- 15 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the documentation in AnnotationUtils was inconsistent, and at times even misleading, with regard to finding annotations that are "present" or "directly present" on annotated elements. This commit defines the terminology used within AnnotationUtils and introduces the explicit notion of "meta-present" to denote that annotations are present within annotation hierarchies above annotated elements. Issue: SPR-13030
-
- 13 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
This commit improves the documentation for AnnotationUtils and AnnotatedElementUtils by explaining that the scope of most annotation searches is limited to finding the first such annotation, resulting in additional such annotations being silently ignored. Issue: SPR-13015
-
- 06 5月, 2015 1 次提交
-
-
由 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
-
- 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 提交于
-
由 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 提交于
Issue: SPR-12940
-
- 04 4月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Also refines logIntrospectionFailure to just log at debug level for meta-annotation introspection failures. Issue: SPR-12889
-
- 31 3月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
AnnotationUtils.getAnnotationAttributes makes Method accessible (analogous to AnnotationUtils.getValue) Issue: SPR-12858
-
- 20 1月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12604
-
- 08 1月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
This commit updates the Javadoc for findAnnotation() to reflect recent changes to the algorithm it implements.
-
- 02 12月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12493
-
- 29 10月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
Normalized AnnotationAttributesReadingVisitor class layout and improved diagnostics through delegating to AnnotationUtils Issue: SPR-12387
-
- 21 10月, 2014 2 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12325
-
由 Juergen Hoeller 提交于
AnnotationUtils favors local composed annotations over interface annotations and consistently logs introspection failures via lazily initialized logger Issue: SPR-12355 Issue: SPR-12325 Issue: SPR-12329
-
- 08 8月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-12065
-
- 02 8月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
-
- 01 7月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 27 6月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
ReflectionUtils caches Class.getDeclaredMethods() results; AnnotationUtils caches findAnnotation results Issue: SPR-11882
-
- 24 6月, 2014 2 次提交
-
-
由 Juergen Hoeller 提交于
AnnotationUtils defensively catches and logs unexpected exceptions from retrieval attempts (proceeding like the annotation wasn't there) Issue: SPR-11874
-
由 Juergen Hoeller 提交于
AnnotationUtils defensively catches unexpected exceptions from retrieval attempts (proceeding like the annotation wasn't there) This is analogous to what the JVM does for cases where the annotation type itself isn't present on the classpath. We're effectively extending that policy to values referenced within an annotation declaration. Issue: SPR-11874
-
- 30 4月, 2014 2 次提交
-
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
-
- 29 4月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 23 4月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 20 3月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, Spring supported meta-annotation attribute overrides in custom composed annotations with reflection-based annotation processing but not with ASM-based annotation processing. This commit ensures that meta-annotation attribute overrides are supported in AnnotationMetadataReadingVisitor.getAnnotationAttributes(). Issue: SPR-11574
-
- 27 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
The previous commit introduced a dependency on Class.getDeclaredAnnotation() which is a Java 8 API. This commit refactors AnnotationUtils.findAnnotation(Class, Class, Set) to use Class.getAnnotation() in conjunction with isAnnotationDeclaredLocally() in order to achieve the same desired behavior. Issue: SPR-11475
-
- 26 2月, 2014 2 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the implementations of findAnnotation() in AnnotationUtils and getAnnotationAttributes() in AnnotatedElementUtils favored inherited annotations and inherited composed annotations over composed annotations that are declared closer to the starting class passed to these methods. This commit addresses this issue as follows: - Refactored AnnotationUtils to use getDeclaredAnnotation() and getDeclaredAnnotations() instead of getAnnotation() and getAnnotations() where appropriate. - AnnotatedElementUtils.doProcess() supports a traverseClassHierarchy flag to control whether the class hierarchy should be traversed, using getDeclaredAnnotations() instead of getAnnotations() if the flag is true. - Overhauled Javadoc in AnnotatedElementUtils. Issue: SPR-11475
-
由 Sam Brannen 提交于
This commit introduces a new isInJavaLangAnnotationPackage(Annotation) method in AnnotationUtils. This method is now used in AnnotationUtils, AnnotatedElementUtils, and MetaAnnotationUtils to ensure that search algorithms do no search for meta-annotations on annotations in the "java.lang.annotation" package. The following are some empirical results from this change: - The number of times that the findAnnotation(Class,Class,Set) method in AnnotationUtils is recursively invoked while executing AnnotationUtilsTests drops from 51 to 29. - The number of times that the process(AnnotatedElement) method in AnnotationUtils.AnnotationCollector is recursively invoked while executing AnnotationUtilsTests.getRepeatableFromMethod() drops from 16 to 2. - The number of times that the doProcess() method in AnnotatedElementUtils is recursively invoked while executing the "getAnnotationAttributes() On MetaCycleAnnotatedClass with missing target meta-annotation" test in AnnotatedElementUtilsTests drops from 23 to 5. - The number of times that the findAnnotationDescriptor(Class,Set,Class) method in MetaAnnotationUtils is recursively invoked while executing the "findAnnotationDescriptor() on MetaCycleAnnotatedClass with missing target meta-annotation" test in MetaAnnotationUtilsTests drops from 16 to 8. Issue: SPR-11483
-
- 22 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
-