From 295b016aac8c8690a04bc8a80a85ed32d0d46c78 Mon Sep 17 00:00:00 2001 From: JAY <112849442+JAY-0905@users.noreply.github.com> Date: Fri, 14 Jun 2024 01:28:51 +0800 Subject: [PATCH] Using defined constants (#1356) --- .../cloud/autoconfigure/RefreshAutoConfiguration.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.java b/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.java index 7bba96493..8685521f0 100644 --- a/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.java +++ b/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.java @@ -130,7 +130,7 @@ public RefreshEventListener refreshEventListener(ContextRefresher contextRefresh return new RefreshEventListener(contextRefresher); } - @ConfigurationProperties("spring.cloud.refresh") + @ConfigurationProperties(REFRESH_SCOPE_PREFIX) public static class RefreshProperties { /** @@ -219,7 +219,7 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t if (isApplicable(registry, name, definition)) { BeanDefinitionHolder holder = new BeanDefinitionHolder(definition, name); BeanDefinitionHolder proxy = ScopedProxyUtils.createScopedProxy(holder, registry, true); - definition.setScope("refresh"); + definition.setScope(REFRESH_SCOPE_NAME); if (registry.containsBeanDefinition(proxy.getBeanName())) { registry.removeBeanDefinition(proxy.getBeanName()); } @@ -252,7 +252,7 @@ private void bindEnvironmentIfNeeded(BeanDefinitionRegistry registry) { if (this.environment == null) { this.environment = new StandardEnvironment(); } - Binder.get(this.environment).bind("spring.cloud.refresh", Bindable.ofInstance(this)); + Binder.get(this.environment).bind(REFRESH_SCOPE_PREFIX, Bindable.ofInstance(this)); this.bound = true; } }