(Eclipse) PMD has this setting MissingSerialVersionUID
It would be nice if PMD could collect the list of serialVersionUIDs and report duplicates.
For example someone copies and pastes a class and forgets to generate a new UID..
Of course it won't match it against serial UIDs of objects in Jars etc, but at least the above would be useful.
Also would be nice if maven pmd could analyze serailVersionUIDs against child modules to find duplicates..
Not sure about the need for a duplicate check since the serialVersionUid is used to decide if a serialized version of a class is compatible with class of same name not different classes (that should fail based on the name/package mismatch). I personally would prefer that the default id (-1) from Eclipse was detected and flagged. I see folks do that and find that to be an issue (If someone had saved serial state and got a new version of file with -1 defined as UID it would fail the load of the object, etc). Maybe a ability to define the default/not allowed values as part of the rule.
Last edit: lhasadad 2013-08-30