1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

1. try执行后无catch 依然是return null

2. 变量后续没用到可定义到 try 内
3. 添加UP/DOWN 常量值
This commit is contained in:
eden-yuan
2021-05-24 15:22:25 +08:00
parent 55b3336b6c
commit c3d393b09e
4 changed files with 25 additions and 7 deletions

View File

@@ -132,7 +132,6 @@ public class DataSourcePropertiesConfiguration {
if (!ObjectUtils.isEmpty(field.get(this))) {
return field.getName();
}
return null;
}
catch (IllegalAccessException e) {
// won't happen

View File

@@ -86,9 +86,8 @@ public abstract class SentinelConverter<T extends Object>
});
for (Object obj : sourceArray) {
String item = null;
try {
item = objectMapper.writeValueAsString(obj);
String item = objectMapper.writeValueAsString(obj);
Optional.ofNullable(convertRule(item))
.ifPresent(convertRule -> ruleCollection.add(convertRule));
}