Fix:Alibaba Coding Guidelines-Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals。 (#2919)

This commit is contained in:
Tocker
2020-08-20 21:17:44 +08:00
committed by GitHub
parent 576406a4ce
commit b82c8bca83
13 changed files with 23 additions and 23 deletions

View File

@@ -47,11 +47,11 @@ public class KuduSyncService {
public void sync(KuduMappingConfig config, Dml dml) {
if (config != null) {
String type = dml.getType();
if (type != null && type.equalsIgnoreCase("INSERT")) {
if (type != null && "INSERT".equalsIgnoreCase(type)) {
insert(config, dml);
} else if (type != null && type.equalsIgnoreCase("UPDATE")) {
} else if (type != null && "UPDATE".equalsIgnoreCase(type)) {
upsert(config, dml);
} else if (type != null && type.equalsIgnoreCase("DELETE")) {
} else if (type != null && "DELETE".equalsIgnoreCase(type)) {
delete(config, dml);
}
if (logger.isDebugEnabled()) {