On Intellij, how would you be able to generate a SerialVersionUID for classes that are written in Kotlin?
I've enabled the inspection in Intellij that does this:
Reports any Serializable classes which do not provide a serialVersionUID field. Without a serialVersionUID field, any change to a class will make previously serialized versions unreadable.
But this only works with Java classes
You are right. This inspection does not work for Kotlin classes. Maybe you could file an issue to Jetbrains so that they could fix it.
For generation of SerialVersionUID you can use JDK's build-in command serialver.
E:\workspace\target\classes>serialver Address
Address: static final long serialVersionUID = -687991492884005033L;
Other usage examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With