Consistent hasAnnotation check for findMergedAnnotation lookup

Issue: SPR-16933
This commit is contained in:
Juergen Hoeller
2018-08-08 23:54:56 +02:00
parent 3f7d4b107e
commit 247ec572b2
5 changed files with 50 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 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.
@@ -21,11 +21,11 @@ import java.lang.reflect.Method;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListenerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.AnnotatedElementUtils;
/**
* {@link EventListenerFactory} implementation that handles {@link TransactionalEventListener}
* annotated method.
* annotated methods.
*
* @author Stephane Nicoll
* @since 4.2
@@ -47,7 +47,7 @@ public class TransactionalEventListenerFactory implements EventListenerFactory,
@Override
public boolean supportsMethod(Method method) {
return (AnnotationUtils.findAnnotation(method, TransactionalEventListener.class) != null);
return AnnotatedElementUtils.hasAnnotation(method, TransactionalEventListener.class);
}
@Override