Why is "serialVersionUID not present" inspection disabled by default?

已回答

Why is "serialVersionUID not present" inspection disabled by default? As it is generally recognized as a good practice to declare serialVersionUID for Serializable classes, why is thy inspection disabled by default? For example Eclipse has it enabled.

0
正式评论

Of the many hundreds of inspections provided, we try to enable by default only the most useful inspections which produce the fewest unnecessary warnings. Many projects which do not use serialization still contain many classes that are Serializable by inheritance. In these projects the warnings would just be unnecessary noise. Therefore it's disabled by default.

请先登录再写评论。