Update JsonUtils.java

修复升级fastjson到1.2.28后JSONUtils报错的问题
This commit is contained in:
孙鹏
2017-03-16 20:01:42 +08:00
committed by GitHub
parent 11d0712291
commit 045a2e5a50
@@ -99,5 +99,17 @@ public class JsonUtils {
// 优先使用name
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());
}
}
}