提交 9738e488 编写于 作者: P Phillip Webb 提交者: Juergen Hoeller

Use ReflectionUtils to get declared methods

Update `StandardAnnotationMetadata` to use `ReflectionUtils` when
obtaining declared methods. This update is primarily so that the common
method cache can be used.

Closes gh-22907
上级 1fa59378
......@@ -27,6 +27,7 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ReflectionUtils;
/**
* {@link AnnotationMetadata} implementation that uses standard reflection
......@@ -151,7 +152,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
public boolean hasAnnotatedMethods(String annotationName) {
if (AnnotationUtils.isCandidateClass(getIntrospectedClass(), annotationName)) {
try {
Method[] methods = getIntrospectedClass().getDeclaredMethods();
Method[] methods = ReflectionUtils.getDeclaredMethods(getIntrospectedClass());
for (Method method : methods) {
if (!method.isBridge() && method.getAnnotations().length > 0 &&
AnnotatedElementUtils.isAnnotated(method, annotationName)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册