Async annotations on interface methods with CGLIB proxies

Issue: SPR-14949
This commit is contained in:
Juergen Hoeller
2017-04-26 18:16:40 +02:00
parent 42d6d7ec4e
commit 6c43d14a77
5 changed files with 61 additions and 22 deletions

View File

@@ -47,10 +47,8 @@ import org.springframework.util.ClassUtils;
*
* @author Juergen Hoeller
* @since 3.0
* @see org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
* @see org.springframework.stereotype.Repository
* @see org.springframework.dao.DataAccessException
* @see org.springframework.dao.support.PersistenceExceptionTranslator
* @see Async
* @see AnnotationAsyncExecutionInterceptor
*/
@SuppressWarnings("serial")
public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements BeanFactoryAware {
@@ -157,7 +155,7 @@ public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements B
ComposablePointcut result = null;
for (Class<? extends Annotation> asyncAnnotationType : asyncAnnotationTypes) {
Pointcut cpc = new AnnotationMatchingPointcut(asyncAnnotationType, true);
Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(asyncAnnotationType);
Pointcut mpc = new AnnotationMatchingPointcut(null, asyncAnnotationType, true);
if (result == null) {
result = new ComposablePointcut(cpc);
}

View File

@@ -25,7 +25,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
@@ -215,7 +214,7 @@ public class EnableAsyncTests {
ctx.close();
}
@Test @Ignore // TODO
@Test
public void spr14949FindsOnInterfaceWithCglibProxy() throws InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Spr14949ConfigB.class);