From ffce3371f6e8810f083411babc7a4fa38cff0897 Mon Sep 17 00:00:00 2001 From: cprayer Date: Thu, 25 Feb 2021 10:00:12 +0900 Subject: [PATCH] Add Bootstrapper initialize method to fix typo --- .../java/org/springframework/boot/Bootstrapper.java | 11 +++++++++++ .../org/springframework/boot/SpringApplication.java | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/Bootstrapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/Bootstrapper.java index 4e67042bece3..b9f13813fe77 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/Bootstrapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/Bootstrapper.java @@ -31,6 +31,17 @@ public interface Bootstrapper { * Initialize the given {@link BootstrapRegistry} with any required registrations. * @param registry the registry to initialize */ + default void initialize(BootstrapRegistry registry) { + intitialize(registry); + } + + /** + * Initialize the given {@link BootstrapRegistry} with any required registrations. + * @param registry the registry to initialize + * @deprecated since 2.4.4 in favor of + * {@link Bootstrapper#initialize(BootstrapRegistry)} + */ + @Deprecated void intitialize(BootstrapRegistry registry); } 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 9d6bb30bb54f..5eb89adae7c7 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 @@ -349,7 +349,7 @@ public ConfigurableApplicationContext run(String... args) { private DefaultBootstrapContext createBootstrapContext() { DefaultBootstrapContext bootstrapContext = new DefaultBootstrapContext(); - this.bootstrappers.forEach((initializer) -> initializer.intitialize(bootstrapContext)); + this.bootstrappers.forEach((initializer) -> initializer.initialize(bootstrapContext)); return bootstrapContext; }