Skip to content
Snippets Groups Projects
Unverified Commit fc3640ab authored by 陈健斌's avatar 陈健斌 Committed by GitHub
Browse files

bugfix: fix can not get boolean value in configuration (#3205)

parent 11ffe19a
No related branches found
No related tags found
No related merge requests found
......@@ -153,7 +153,8 @@ public class FileConfiguration extends AbstractConfiguration {
}
ConfigFuture configFuture = new ConfigFuture(dataId, defaultValue, ConfigOperation.GET, timeoutMills);
configOperateExecutor.submit(new ConfigOperateRunnable(configFuture));
return (String)configFuture.get();
Object getValue = configFuture.get();
return getValue == null ? null : String.valueOf(getValue);
}
@Override
......@@ -319,11 +320,13 @@ public class FileConfiguration extends AbstractConfiguration {
try {
String currentConfig =
ConfigurationFactory.getInstance().getLatestConfig(dataId, null, DEFAULT_CONFIG_TIMEOUT);
String oldConfig = listenedConfigMap.get(dataId);
if (ObjectUtils.notEqual(currentConfig, oldConfig)) {
listenedConfigMap.put(dataId, currentConfig);
event.setDataId(dataId).setNewValue(currentConfig).setOldValue(oldConfig);
listener.onChangeEvent(event);
if (StringUtils.isNotBlank(currentConfig)) {
String oldConfig = listenedConfigMap.get(dataId);
if (ObjectUtils.notEqual(currentConfig, oldConfig)) {
listenedConfigMap.put(dataId, currentConfig);
event.setDataId(dataId).setNewValue(currentConfig).setOldValue(oldConfig);
listener.onChangeEvent(event);
}
}
} catch (Exception exx) {
LOGGER.error("fileListener execute error:{}", exx.getMessage());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment