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:
@@ -49,7 +49,7 @@ public class MQMessageUtils {
|
||||
int i = pkHashConfig.lastIndexOf(":");
|
||||
if (i > 0) {
|
||||
String pkStr = pkHashConfig.substring(i + 1);
|
||||
if (pkStr.equalsIgnoreCase("$pk$")) {
|
||||
if ("$pk$".equalsIgnoreCase(pkStr)) {
|
||||
data.hashMode.autoPkHash = true;
|
||||
} else {
|
||||
data.hashMode.pkNames = Lists.newArrayList(StringUtils.split(pkStr,
|
||||
|
||||
@@ -78,7 +78,7 @@ public class JdbcTypeUtil {
|
||||
|
||||
public static Object typeConvert(String tableName, String columnName, String value, int sqlType, String mysqlType) {
|
||||
if (value == null
|
||||
|| (value.equals("") && !(isText(mysqlType) || sqlType == Types.CHAR || sqlType == Types.VARCHAR || sqlType == Types.LONGVARCHAR))) {
|
||||
|| ("".equals(value) && !(isText(mysqlType) || sqlType == Types.CHAR || sqlType == Types.VARCHAR || sqlType == Types.LONGVARCHAR))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user