diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java index 774322168e..f560a145d8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java @@ -22,7 +22,6 @@ import javax.lang.model.element.Modifier; import org.springframework.aot.generate.GeneratedMethod; import org.springframework.aot.generate.GenerationContext; -import org.springframework.aot.generate.MethodReference; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.aot.BeanRegistrationAotContribution; import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor; @@ -172,8 +171,7 @@ class ChildManagementContextInitializer .returns(ChildManagementContextInitializer.class) .addStatement("return instance.withApplicationContextInitializer(new $L())", generatedInitializerClassName)); - beanRegistrationCode.addInstancePostProcessor( - MethodReference.ofStatic(beanRegistrationCode.getClassName(), postProcessorMethod.getName())); + beanRegistrationCode.addInstancePostProcessor(postProcessorMethod.toMethodReference()); } }