explicit serialVersionUID considered harmful?

前端 未结 6 1043
小鲜肉
小鲜肉 2020-12-09 02:35

I am probably risking some downvotes on this.

It seems to me that explicitly specifying serialVersionUID for new classes is bad. Consider the two cases of not changi

6条回答
  •  渐次进展
    2020-12-09 03:25

    Whether you go for serialVersionUID or not (I suggest you do), then you should really consider creating a comprehensive set of tests for serial compatibility.

    It's also worth designing the serial format with care. It is effectively a public API.

提交回复
热议问题