Cleaning up code I launched serialver to create serialVersionUIDs for some serializable classes. Wondering why IntelliJ IDEA did not seem to provide a generator for UIDs, I browsed the code inspection settings and it turns out that there actually is one – but it is disabled by default. To use it, go to
Settings -> Errors -> Serialization issues -> Serializable class without ‘serialVersionUID’
When editing a Serializable class without a serialVersionUID field set, IDEA now displays a warning and provides a Quickfix (Alt+Enter) to generate one.
Dave Cheong said
Thanks for the tip! I was wondering the same thing myself — ie why do I have to go to serialver to do that!
cheers,
dave
Chas said
Thank you!
Elwyn said
Thanks for that. Time saved!
Rob said
Thanks!
Artyom said
Great tip, thanks a lot!
Chess said
Thanks a lot – plugins are not working @Idea 8.1, that helped.
Amar said
Great tip. I was just woundering why the GeneratesSerialVersionUID plugin was not working and thought of updating the code. this will save a lot of my time.
anony said
I do not find it helpful to initialize a serialVersionId with a 0 value. So, quick fix initialize version id is not very helpful.
anony said
I do not find it helpful to initialize a serialVersionId with a 0 value. So, quick fix initialize version id is not very helpful.
-> I had a manual typed serialVersionId field in my class. If you delete the field, quick fix on class will generate new field with valid serial version id. That fixed my prob.
Daniel Lichtenberger said
If ‘quick fix’ initializes serialVersionId with 0, something is broken in your version of IDEA.
Dmitry said
In the Intellij Idea 9.0 the sequence of actions has been changed.
settings->Inspections->Serializable class without ‘serialVersionUID’
Dustin said
Note that in IntelliJ 9, you need to have the Inspection Gadgets plugin installed for this inspection to be available.
you said
(Y) Thank you