Several code generators (and code monkeys) create serializable classes with no explicit serialVersionUid set. By default, Eclipse puts warnings on these classes. However, it does have a "Quick Fix" that automatically add either a generated or default serialVersionUid declaration, preceded by an empty JavaDoc comment. What if I want to change this output ... say fill in the JavaDoc, or delete it entirely? Or maybe change the default value for the the id? I've looked through the code templates, but nothing is jumping out at me.
I think this is also likely to cause the Java compiler to spit out a warning. However, if you look at the suggested fixes that Eclipse offers, you'll see that there's also an option to ignore the missing Serial version ID. It causes an annotation to be placed just ahead of the class definitions.
Actually, it's not a bad idea to use the serial version ID. It doesn't require much space and it may someday keep you out of trouble when working with serialized objects that are being passed around between different releases of code.
Then again, there are times when you get this because you're working with a class that's defined as serializable even though you never intend to actually serialize it. Which is why you have the option to suppress the warning.
Customer surveys are for companies who didn't pay proper attention to begin with.
Oh, probably I wasn't clear. I do want to have the serial version id; I just want to have control of what Eclipse puts there. In particular, I don't like the empty comment it generates, since that means I have to either fill the comment in or delete it entirely.
Oh that. Ugly, ain't it? It should be coming from the same place that general member comment JavaDoc prototypes do, except I think it's missing something.
Also, the number it assigns is some kind of hash that it gets from compiling the class. Usually, when I make any changes I remove the value and rerun the quickfix to get an updated number.
If you have your own standards for the serial version id, create a template for it and use that.