Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum serialVersionUID change should not report as incompatible #131

Closed
granthenke opened this issue Apr 29, 2016 · 1 comment
Closed

Enum serialVersionUID change should not report as incompatible #131

granthenke opened this issue Apr 29, 2016 · 1 comment

Comments

@granthenke
Copy link

If you add a value to an Enum japicmp will report:

MODIFIED (Serializable incompatible(!): default serialVersionUID changed)

According to the serialization spec (http://docs.oracle.com/javase/8/docs/platform/serialization/spec/serial-arch.html#a6469) the serialization of Enums is a special case and does not leverage the serialVersionUID:

Enum constants are serialized differently than ordinary serializable or externalizable objects. The serialized form of an enum constant consists solely of its name; field values of the constant are not present in the form....
Similarly, any serialPersistentFields or serialVersionUID field declarations are also ignored--all enum types have a fixed serialVersionUID of 0L.

@siom79
Copy link
Owner

siom79 commented May 14, 2016

serialVersionUID is ignored for enums.

@siom79 siom79 closed this as completed May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants