From f28cedea4263e59b5f8b86f1b41927461fe68ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=AA=E5=BD=B1oO?= <213539@qq.com> Date: Thu, 14 Jan 2021 09:38:10 +0800 Subject: [PATCH] fix #4686 (#4692) --- .../main/java/com/alibaba/nacos/api/config/ConfigType.java | 7 ++++++- .../nacos/api/config/annotation/NacosConfigListener.java | 4 ++-- .../config/annotation/NacosConfigurationProperties.java | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/config/ConfigType.java b/api/src/main/java/com/alibaba/nacos/api/config/ConfigType.java index d70e2a98d8f..cab303b3598 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/ConfigType.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/ConfigType.java @@ -53,7 +53,12 @@ public enum ConfigType { /** * config type is "yaml". */ - YAML("yaml"); + YAML("yaml"), + + /** + * not a real type. + */ + UNSET("unset"); String type; diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java index 0025557394a..810833d5928 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java @@ -57,9 +57,9 @@ /** * Nacos Config type. * - * @return "properties" + * @return default value is {@link ConfigType#UNSET} */ - ConfigType type() default ConfigType.PROPERTIES; + ConfigType type() default ConfigType.UNSET; /** * Specify {@link NacosConfigConverter Nacos configuraion convertor} class to convert target type instance. diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java index 37b6507be89..0e6bc518daa 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java @@ -72,9 +72,9 @@ /** * config style. * - * @return default value is {@link ConfigType#PROPERTIES} + * @return default value is {@link ConfigType#UNSET} */ - ConfigType type() default ConfigType.PROPERTIES; + ConfigType type() default ConfigType.UNSET; /** * It indicates the properties of current doBind bean is auto-refreshed when Nacos configuration is changed.