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:
@@ -312,7 +312,7 @@ public class MappingConfig implements AdapterConfig {
|
||||
columnItem.setRowKey(true);
|
||||
rowKeyColumn = columnItem;
|
||||
} else {
|
||||
if (field == null || field.equals("")) {
|
||||
if (field == null || "".equals(field)) {
|
||||
columnItem.setFamily(family);
|
||||
columnItem.setQualifier(columnField.getKey());
|
||||
} else {
|
||||
|
||||
@@ -31,11 +31,11 @@ public class HbaseSyncService {
|
||||
public void sync(MappingConfig 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)) {
|
||||
update(config, dml);
|
||||
} else if (type != null && type.equalsIgnoreCase("DELETE")) {
|
||||
} else if (type != null && "DELETE".equalsIgnoreCase(type)) {
|
||||
delete(config, dml);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user