- 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 4 次提交
-
-
由 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
-
由 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
-
- 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
-
- 10 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
Issue: SPR-13007
-
- 07 5月, 2015 1 次提交
-
-
由 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
-
- 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 3 次提交
-
-
由 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 提交于
-
由 Sam Brannen 提交于
-
- 21 2月, 2015 1 次提交
-
-
由 Rossen Stoyanchev 提交于
-
- 25 1月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
-
- 21 10月, 2014 2 次提交
-
-
由 Juergen Hoeller 提交于
-
由 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
-
- 04 9月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-11310 Issue: SPR-10548
-
- 05 6月, 2014 1 次提交
-
-
由 Stephane Nicoll 提交于
This commit introduces OrderProvider and OrderProviderComparator, two interfaces designed to externalize how a collection of element is sorted according to their order value. FactoryAwareOrderProvider is an OrderProvider implementation that knows about the objects to order and the corresponding BeanFactory instance. This allows to retrieve additional metadata about the actual instances to sort, such as its factory method. A @Bean method can now holds an additional @order to define the order value that this bean should have when injected as part of a collection or array. Issue: SPR-11310
-
- 01 4月, 2014 1 次提交
-
-
由 Stephane Nicoll 提交于
This commit rationalizes the use of @order so that the standard @Priority annotation can be used instead. The handling of both annotations are now defined in OrderUtils. This also updates the link to the JavaEE API so that we refer to JavaEE7 instead of JavaEE6. Issue: SPR-11639
-
- 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
-
- 20 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, AnnotationUtils.findAnnotation(Class, Class) claimed to recursively search through annotations; however, only one level of annotations was supported by the algorithm. This commit alters the search algorithm so that nested meta-annotations (i.e., meta-annotations on meta-annotations) are also supported. Issue: SPR-11448
-
- 19 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
TransactionalAndOrderedClass now extends TransactionalClass. The tests passed anyway, but they did not actually verify what was meant to be verified.
-
- 09 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
-