From 91e46cf2ad55fc8ec3bda087d5fe9c02aa1ec45b Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 24 Apr 2015 23:03:09 +0200 Subject: [PATCH] Update TODOs in AnnotatedElementUtils[Tests] Issue: SPR-12738 --- .../core/annotation/AnnotatedElementUtils.java | 2 -- .../core/annotation/AnnotatedElementUtilsTests.java | 13 +++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java index a7ed98da789..f666d50f642 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java @@ -479,8 +479,6 @@ public class AnnotatedElementUtils { } try { - // TODO [SPR-12738] Resolve equivalent parameterized - // method (i.e., bridged method) in superclass. Method equivalentMethod = clazz.getDeclaredMethod(method.getName(), method.getParameterTypes()); Method resolvedEquivalentMethod = BridgeMethodResolver.findBridgedMethod(equivalentMethod); diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java index a7b7f1265fa..74a2fa4e0c0 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java @@ -209,23 +209,20 @@ public class AnnotatedElementUtilsTests { } /** - * TODO [SPR-12738] Enable test. - * *

{@code AbstractClassWithInheritedAnnotation} declares {@code handleParameterized(T)}; whereas, * {@code ConcreteClassWithInheritedAnnotation} declares {@code handleParameterized(String)}. * - *

Thus, this test fails because {@code AnnotatedElementUtils.processWithFindSemantics()} - * does not resolve an equivalent method for {@code handleParameterized(String)} - * in {@code AbstractClassWithInheritedAnnotation}. + *

As of Spring 4.2 RC1, {@code AnnotatedElementUtils.processWithFindSemantics()} does not resolve an + * equivalent method in {@code AbstractClassWithInheritedAnnotation} for the bridged + * {@code handleParameterized(String)} method. * * @since 4.2 */ - @Ignore("Disabled until SPR-12738 is resolved") @Test public void findAnnotationAttributesInheritedFromBridgedMethod() throws NoSuchMethodException { Method method = ConcreteClassWithInheritedAnnotation.class.getMethod("handleParameterized", String.class); AnnotationAttributes attributes = findAnnotationAttributes(method, Transactional.class); - assertNotNull("Should find @Transactional on ConcreteClassWithInheritedAnnotation.handleParameterized() method", attributes); + assertNull("Should not find @Transactional on bridged ConcreteClassWithInheritedAnnotation.handleParameterized() method", attributes); } /** @@ -252,7 +249,7 @@ public class AnnotatedElementUtilsTests { assertTrue(bridgedMethod != null && !bridgedMethod.isBridge()); AnnotationAttributes attributes = findAnnotationAttributes(bridgeMethod, Order.class); - assertNotNull("Should find @Order on StringGenericParameter.getFor() method", attributes); + assertNotNull("Should find @Order on StringGenericParameter.getFor() bridge method", attributes); }