diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index efca9ececa..d546feb577 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -39,7 +39,6 @@ import org.springframework.aot.AotDetector; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.beans.BeansException; -import org.springframework.beans.CachedIntrospectionResults; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -305,7 +304,6 @@ public class SpringApplication { try { ApplicationArguments applicationArguments = new DefaultApplicationArguments(args); ConfigurableEnvironment environment = prepareEnvironment(listeners, bootstrapContext, applicationArguments); - configureIgnoreBeanInfo(environment); Banner printedBanner = printBanner(environment); context = createApplicationContext(); context.setApplicationStartup(this.applicationStartup); @@ -532,14 +530,6 @@ public class SpringApplication { protected void configureProfiles(ConfigurableEnvironment environment, String[] args) { } - private void configureIgnoreBeanInfo(ConfigurableEnvironment environment) { - if (System.getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME) == null) { - Boolean ignore = environment.getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME, - Boolean.class, Boolean.TRUE); - System.setProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME, ignore.toString()); - } - } - /** * Bind the environment to the {@link SpringApplication}. * @param environment the environment to bind diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index e3c069ac5f..781a3db7d6 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -44,7 +44,6 @@ import reactor.core.publisher.Mono; import org.springframework.aot.AotDetector; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; -import org.springframework.beans.CachedIntrospectionResults; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCurrentlyInCreationException; import org.springframework.beans.factory.ObjectProvider; @@ -194,7 +193,6 @@ class SpringApplicationTests { this.context.close(); } System.clearProperty("spring.main.banner-mode"); - System.clearProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME); SpringApplicationShutdownHookInstance.reset(); } @@ -280,25 +278,6 @@ class SpringApplicationTests { assertThat(output).contains("o.s.b.SpringApplication"); } - @Test - void setIgnoreBeanInfoPropertyByDefault(CapturedOutput output) { - SpringApplication application = new SpringApplication(ExampleConfig.class); - application.setWebApplicationType(WebApplicationType.NONE); - this.context = application.run(); - String property = System.getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME); - assertThat(property).isEqualTo("true"); - } - - @Test - void disableIgnoreBeanInfoProperty() { - System.setProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME, "false"); - SpringApplication application = new SpringApplication(ExampleConfig.class); - application.setWebApplicationType(WebApplicationType.NONE); - this.context = application.run(); - String property = System.getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME); - assertThat(property).isEqualTo("false"); - } - @Test void triggersConfigFileApplicationListenerBeforeBinding() { SpringApplication application = new SpringApplication(ExampleConfig.class);