mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Shared empty InjectionMetadata/LifecycleMetadata instance
Closes gh-22570
This commit is contained in:
+2
-2
@@ -369,7 +369,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
||||
|
||||
private InjectionMetadata buildResourceMetadata(final Class<?> clazz) {
|
||||
if (!AnnotationUtils.isCandidateClass(clazz, resourceAnnotationTypes)) {
|
||||
return new InjectionMetadata(clazz, Collections.emptyList());
|
||||
return InjectionMetadata.EMPTY;
|
||||
}
|
||||
|
||||
List<InjectionMetadata.InjectedElement> elements = new ArrayList<>();
|
||||
@@ -448,7 +448,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
||||
}
|
||||
while (targetClass != null && targetClass != Object.class);
|
||||
|
||||
return new InjectionMetadata(clazz, elements);
|
||||
return InjectionMetadata.forElements(elements, clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user