Transaction annotations on interface methods with CGLIB proxies
Issue: SPR-14322
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -150,12 +150,10 @@ public class AnnotationTransactionAttributeSource extends AbstractFallbackTransa
|
||||
* or {@code null} if none was found
|
||||
*/
|
||||
protected TransactionAttribute determineTransactionAttribute(AnnotatedElement ae) {
|
||||
if (ae.getAnnotations().length > 0) {
|
||||
for (TransactionAnnotationParser annotationParser : this.annotationParsers) {
|
||||
TransactionAttribute attr = annotationParser.parseTransactionAnnotation(ae);
|
||||
if (attr != null) {
|
||||
return attr;
|
||||
}
|
||||
for (TransactionAnnotationParser annotationParser : this.annotationParsers) {
|
||||
TransactionAttribute attr = annotationParser.parseTransactionAnnotation(ae);
|
||||
if (attr != null) {
|
||||
return attr;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,8 @@ public class SpringTransactionAnnotationParser implements TransactionAnnotationP
|
||||
|
||||
@Override
|
||||
public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae) {
|
||||
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(ae, Transactional.class);
|
||||
AnnotationAttributes attributes = AnnotatedElementUtils.findMergedAnnotationAttributes(
|
||||
ae, Transactional.class, false, false);
|
||||
if (attributes != null) {
|
||||
return parseTransactionAnnotation(attributes);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.transaction.annotation;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
@@ -166,7 +165,7 @@ public class EnableTransactionManagementTests {
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
@Test @Ignore // TODO
|
||||
@Test
|
||||
public void spr14322FindsOnInterfaceWithCglibProxy() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Spr14322ConfigB.class);
|
||||
TransactionalTestInterface bean = ctx.getBean(TransactionalTestInterface.class);
|
||||
|
||||
Reference in New Issue
Block a user