Consistent bridge method handling in annotation post-processors

Issue: SPR-12495
This commit is contained in:
Juergen Hoeller
2014-12-22 16:42:47 +01:00
parent 61a6bc0139
commit dc15070877
3 changed files with 17 additions and 18 deletions

View File

@@ -401,10 +401,9 @@ public class PersistenceAnnotationBeanPostProcessor
}
for (Method method : targetClass.getDeclaredMethods()) {
method = BridgeMethodResolver.findBridgedMethod(method);
Method mostSpecificMethod = BridgeMethodResolver.findBridgedMethod(ClassUtils.getMostSpecificMethod(method, clazz));
if ((method.isAnnotationPresent(PersistenceContext.class) ||
method.isAnnotationPresent(PersistenceUnit.class)) &&
method.equals(mostSpecificMethod)) {
method.equals(BridgeMethodResolver.findBridgedMethod(ClassUtils.getMostSpecificMethod(method, clazz)))) {
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalStateException("Persistence annotations are not supported on static methods");
}