mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
不应该使用类实例访问静态成员\不应该直接使用不确定的值调用equals容易空指针\final static应该使用大写命名并且使用下划线
This commit is contained in:
@@ -119,7 +119,7 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
@Override
|
||||
public void setStatus(Registration registration, String status) {
|
||||
|
||||
if (!status.equalsIgnoreCase("UP") && !status.equalsIgnoreCase("DOWN")) {
|
||||
if (!"UP".equalsIgnoreCase(status) && !"DOWN".equalsIgnoreCase(status)) {
|
||||
log.warn("can't support status {},please choose UP or DOWN", status);
|
||||
return;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
|
||||
Instance instance = getNacosInstanceFromRegistration(registration);
|
||||
|
||||
if (status.equalsIgnoreCase("DOWN")) {
|
||||
if ("DOWN".equalsIgnoreCase(status)) {
|
||||
instance.setEnabled(false);
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user