Make Java runtime ignore serialVersionUIDs?

前端 未结 5 1023
暗喜
暗喜 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条回答
  •  星月不相逢
    2020-11-29 06:05

    How impractical is this to fix ? If you have the source and can rebuild, can you not just run a script over the entire codebase to insert a

    private long serialVersionUID = 1L;
    

    everywhere ?

提交回复
热议问题