I frequently use the Eclipse quick fix to generate a serial version UID for serializable classes.
Is there any way to do this by default?
It’s one extra click, but with Eclipse selecting quick fixes is generally slowish, and I always generate serial version UID:s when I implement serializable.
This is perhaps not the answer you’re looking for. Presumably, you use Eclipse to generate the same special value that Java would automatically calculate for your class if you didn’t explicitly specify it, something like:
But there’s no good reason to rely on this same algorithm for newly authored classes. What matters is you specify a value, any value. So why not simply do the following?
You could then put this code in Eclipse’s new class template.