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 @@ -364,7 +364,17 @@ private Set<MethodMetadata> retrieveBeanMethodMetadata(SourceClass sourceClass)
364
364
try {
365
365
AnnotationMetadata asm =
366
366
this .metadataReaderFactory .getMetadataReader (original .getClassName ()).getAnnotationMetadata ();
367
- beanMethods = asm .getAnnotatedMethods (Bean .class .getName ());
367
+ Set <MethodMetadata > asmMethods = asm .getAnnotatedMethods (Bean .class .getName ());
368
+ Set <MethodMetadata > reflectionMethods = beanMethods ;
369
+ beanMethods = new LinkedHashSet <>();
370
+ for (MethodMetadata asmMethod : asmMethods ) {
371
+ for (MethodMetadata reflectionMethod : reflectionMethods ) {
372
+ if (reflectionMethod .getMethodName ().equals (asmMethod .getMethodName ())) {
373
+ beanMethods .add (reflectionMethod );
374
+ break ;
375
+ }
376
+ }
377
+ }
368
378
}
369
379
catch (IOException ex ) {
370
380
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