From 22d094933a79c12a7a13a12b3102723507df0e53 Mon Sep 17 00:00:00 2001 From: Wars Date: Sun, 5 Oct 2025 13:34:55 +0800 Subject: [PATCH] perf(context): Remove the metrics code in the default construction method of AnnotationConfigApplicationContext AbstractApplicationContext.applicationStartup can only be injected after the instance construction. This metrics point has no practical effect at present. I think it can be removed. Signed-off-by: Wars --- .../context/annotation/AnnotationConfigApplicationContext.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigApplicationContext.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigApplicationContext.java index 752e74819744..8bdf03e34fac 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigApplicationContext.java @@ -66,9 +66,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex * through {@link #register} calls and then manually {@linkplain #refresh refreshed}. */ public AnnotationConfigApplicationContext() { - StartupStep createAnnotatedBeanDefReader = getApplicationStartup().start("spring.context.annotated-bean-reader.create"); this.reader = new AnnotatedBeanDefinitionReader(this); - createAnnotatedBeanDefReader.end(); this.scanner = new ClassPathBeanDefinitionScanner(this); }