mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
Update JsonUtils.java
修复升级fastjson到1.2.28后JSONUtils报错的问题
This commit is contained in:
@@ -99,5 +99,17 @@ public class JsonUtils {
|
|||||||
// 优先使用name
|
// 优先使用name
|
||||||
serializer.write(address.getHostName());
|
serializer.write(address.getHostName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features)
|
||||||
|
throws IOException {
|
||||||
|
if (object == null) {
|
||||||
|
serializer.writeNull();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
InetAddress address = (InetAddress) object;
|
||||||
|
// 优先使用name
|
||||||
|
serializer.write(address.getHostName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user