Browse Source

Update TODOs in AnnotatedElementUtils[Tests]

Issue: SPR-12738
pull/903/head
Sam Brannen 10 years ago
parent
commit
91e46cf2ad
  1. 2
      spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java
  2. 13
      spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java

2
spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java

@ -479,8 +479,6 @@ public class AnnotatedElementUtils { @@ -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);

13
spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java

@ -209,23 +209,20 @@ public class AnnotatedElementUtilsTests { @@ -209,23 +209,20 @@ public class AnnotatedElementUtilsTests {
}
/**
* TODO [SPR-12738] Enable test.
*
* <p>{@code AbstractClassWithInheritedAnnotation} declares {@code handleParameterized(T)}; whereas,
* {@code ConcreteClassWithInheritedAnnotation} declares {@code handleParameterized(String)}.
*
* <p>Thus, this test fails because {@code AnnotatedElementUtils.processWithFindSemantics()}
* does not resolve an equivalent method for {@code handleParameterized(String)}
* in {@code AbstractClassWithInheritedAnnotation}.
* <p>As of Spring 4.2 RC1, {@code AnnotatedElementUtils.processWithFindSemantics()} does not resolve an
* <em>equivalent</em> method in {@code AbstractClassWithInheritedAnnotation} for the <em>bridged</em>
* {@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 { @@ -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);
}

Loading…
Cancel
Save