Browse Source

Expose reflection metadata with ASM-driven method order

Issue: SPR-14505
(cherry picked from commit 0208198)
pull/1290/head
Juergen Hoeller 9 years ago
parent
commit
4b018407c1
  1. 12
      spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

12
spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

@ -365,7 +365,17 @@ class ConfigurationClassParser { @@ -365,7 +365,17 @@ class ConfigurationClassParser {
try {
AnnotationMetadata asm =
this.metadataReaderFactory.getMetadataReader(original.getClassName()).getAnnotationMetadata();
beanMethods = asm.getAnnotatedMethods(Bean.class.getName());
Set<MethodMetadata> asmMethods = asm.getAnnotatedMethods(Bean.class.getName());
Set<MethodMetadata> reflectionMethods = beanMethods;
beanMethods = new LinkedHashSet<MethodMetadata>();
for (MethodMetadata asmMethod : asmMethods) {
for (MethodMetadata reflectionMethod : reflectionMethods) {
if (reflectionMethod.getMethodName().equals(asmMethod.getMethodName())) {
beanMethods.add(reflectionMethod);
break;
}
}
}
}
catch (IOException ex) {
logger.debug("Failed to read class file via ASM for determining @Bean method order", ex);

Loading…
Cancel
Save