- 06 5月, 2015 2 次提交
-
-
由 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
-
- 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 1 次提交
-
-
由 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
-
- 21 2月, 2015 1 次提交
-
-
由 Rossen Stoyanchev 提交于
-
- 25 1月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
-
- 21 10月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 26 3月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
Changes introduced in conjunction with issue SPR-11475 altered the behavior of StandardAnnotationMetadata such that annotations could be detected on superclasses, specifically in the case where the AnnotatedElementUtils.getAllAnnotationAttributes() method is invoked to obtain multiple annotations of the same type (on the lowest level in the class hierarchy), as is the case for @Profile and @Conditional. This commit partially reverts these changes as follows: - All methods in AnnotatedElementUtils now set the traverseClassHierarchy to false, thereby effectively reverting the changes made in commit 1d30bf83. Note, however, that the changes made to AnnotationUtils remain in place. - Introduced tests in AnnotationMetadataTests that verify behavior present in Spring Framework 4.0.2 and earlier. - Updated tests in AnnotatedElementUtilsTests so that they pass against the reverted changes (i.e., align with the behavior present in Spring Framework 4.0.2 and earlier). - Refined Javadoc in AnnotationMetadata with regard to annotations being "present" vs. "defined". - Refined Javadoc in AnnotatedTypeMetadata. Issue: SPR-11475, SPR-11595
-
- 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
-
- 24 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-11475
-