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:
@@ -83,7 +83,7 @@ public class RocketMQProduceApplication {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
if (this.bindingName.equals("output1")) {
|
||||
if ("output1".equals(this.bindingName)) {
|
||||
int count = 5;
|
||||
for (int index = 1; index <= count; index++) {
|
||||
String msgContent = "msg-" + index;
|
||||
@@ -98,7 +98,7 @@ public class RocketMQProduceApplication {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.bindingName.equals("output3")) {
|
||||
else if ("output3".equals(this.bindingName)) {
|
||||
int count = 20;
|
||||
for (int index = 1; index <= count; index++) {
|
||||
String msgContent = "pullMsg-" + index;
|
||||
|
@@ -41,10 +41,10 @@ public class ZuulConfiguration {
|
||||
|
||||
@Override
|
||||
public BlockResponse fallbackResponse(String route, Throwable cause) {
|
||||
if (route.equals("my-service3")) {
|
||||
if ("my-service3".equals(route)) {
|
||||
return new BlockResponse(433, "Sentinel Block3", route);
|
||||
}
|
||||
else if (route.equals("my-service4")) {
|
||||
else if ("my-service4".equals(route)) {
|
||||
return new BlockResponse(444, "my-service4", route);
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user