Consistent exclusion of bridge methods in annotation post-processors (for Java 8 compatibility)

Issue: SPR-12187
This commit is contained in:
Juergen Hoeller
2014-09-18 23:45:42 +02:00
parent dc57cb2c9f
commit f4219ca06b
4 changed files with 59 additions and 8 deletions

View File

@@ -402,7 +402,7 @@ public class PersistenceAnnotationBeanPostProcessor
for (Method method : targetClass.getDeclaredMethods()) {
PersistenceContext pc = method.getAnnotation(PersistenceContext.class);
PersistenceUnit pu = method.getAnnotation(PersistenceUnit.class);
if ((pc != null || pu != null) &&
if ((pc != null || pu != null) && !method.isBridge() &&
method.equals(ClassUtils.getMostSpecificMethod(method, clazz))) {
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalStateException("Persistence annotations are not supported on static methods");