我也遇到这个BUG了
查看LEANCLOUD里的源码
public static AVObject parseAVObject(String avObjectString) throws Exception {
AVObject object = (AVObject)JSON.parse(avObjectString);
if(object instanceof AVObject && !AVObject.class.equals(object.getClass())) {
object.rebuildInstanceData();
}
return object;
}
我试着用JSONObject.parseObject直接反序列化
TopicComment comment = JSON.parseObject(JSON_DATA, TopicComment.class);
comment.rebuildInstanceData();
亲测可行,TopicComment 是AVObject的子类