mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
Fix:Alibaba Coding Guidelines-Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals。 (#2919)
This commit is contained in:
@@ -181,11 +181,11 @@ public class CommonRest {
|
||||
*/
|
||||
@PutMapping("/syncSwitch/{destination}/{status}")
|
||||
public Result etl(@PathVariable String destination, @PathVariable String status) {
|
||||
if (status.equals("on")) {
|
||||
if ("on".equals(status)) {
|
||||
syncSwitch.on(destination);
|
||||
logger.info("#Destination: {} sync on", destination);
|
||||
return Result.createSuccess("实例: " + destination + " 开启同步成功");
|
||||
} else if (status.equals("off")) {
|
||||
} else if ("off".equals(status)) {
|
||||
syncSwitch.off(destination);
|
||||
logger.info("#Destination: {} sync off", destination);
|
||||
return Result.createSuccess("实例: " + destination + " 关闭同步成功");
|
||||
|
||||
Reference in New Issue
Block a user