Early resolution of unique factory methods in configuration classes

Includes consistent bean class resolution in the enhancement step as well as general reflection optimizations for user-declared methods.

Closes gh-22420
This commit is contained in:
Juergen Hoeller
2019-03-12 17:17:24 +01:00
parent a35adc6ea6
commit 40c62139ae
10 changed files with 271 additions and 142 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 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.
@@ -423,7 +423,7 @@ public class TransactionalTestExecutionListener extends AbstractTestExecutionLis
* as well as annotated interface default methods
*/
private List<Method> getAnnotatedMethods(Class<?> clazz, Class<? extends Annotation> annotationType) {
return Arrays.stream(ReflectionUtils.getUniqueDeclaredMethods(clazz))
return Arrays.stream(ReflectionUtils.getUniqueDeclaredMethods(clazz, ReflectionUtils.USER_DECLARED_METHODS))
.filter(method -> AnnotatedElementUtils.hasAnnotation(method, annotationType))
.collect(Collectors.toList());
}