File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
spring-context/src/main/java/org/springframework/context/annotation Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -365,7 +365,17 @@ private Set<MethodMetadata> retrieveBeanMethodMetadata(SourceClass sourceClass)
365
365
try {
366
366
AnnotationMetadata asm =
367
367
this .metadataReaderFactory .getMetadataReader (original .getClassName ()).getAnnotationMetadata ();
368
- beanMethods = asm .getAnnotatedMethods (Bean .class .getName ());
368
+ Set <MethodMetadata > asmMethods = asm .getAnnotatedMethods (Bean .class .getName ());
369
+ Set <MethodMetadata > reflectionMethods = beanMethods ;
370
+ beanMethods = new LinkedHashSet <MethodMetadata >();
371
+ for (MethodMetadata asmMethod : asmMethods ) {
372
+ for (MethodMetadata reflectionMethod : reflectionMethods ) {
373
+ if (reflectionMethod .getMethodName ().equals (asmMethod .getMethodName ())) {
374
+ beanMethods .add (reflectionMethod );
375
+ break ;
376
+ }
377
+ }
378
+ }
369
379
}
370
380
catch (IOException ex ) {
371
381
logger .debug ("Failed to read class file via ASM for determining @Bean method order" , ex );
You can’t perform that action at this time.
0 commit comments