Make Java runtime ignore serialVersionUIDs?

前端 未结 5 1015
暗喜
暗喜 2020-11-29 05:13

I have to work with a large number of compiled Java classes which didn\'t explicitly specify a serialVersionUID. Because their UIDs were arbitrarily generated by the compile

5条回答
  •  萌比男神i
    2020-11-29 06:02

    The serialization errors at runtime tell you explicitly what the ID is expected to be. Just change your classes to declare these as the ID and everything will be OK. This does involve you making changes but I don't believe that this can be avoided

提交回复
热议问题