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 storage does not work with overridden toString in enum class #300

Closed
nednil opened this issue Apr 8, 2015 · 1 comment
Closed

Enum storage does not work with overridden toString in enum class #300

nednil opened this issue Apr 8, 2015 · 1 comment
Labels
Milestone

Comments

@nednil
Copy link

nednil commented Apr 8, 2015

Enum values are serialized with toString and deserialized using valueOf. ValueOf is generated by the compiler and will only except the name of the enum. This leads to problems when a custom toString for the enum is used since it is not possible to override the valueOf method to handle the matching case.

It would be better to serialize using the enum name method, then deserialize using valueOf. These two methods cannot be overriden so it will prevent any problems with adding custom toString methods to an enum.

@whoshuu whoshuu added the bug label Apr 10, 2015
@whoshuu whoshuu added this to the 1.4.0 milestone Apr 10, 2015
@whoshuu
Copy link
Collaborator

whoshuu commented Apr 10, 2015

References #292.

whoshuu pushed a commit that referenced this issue Apr 11, 2015
References #304
References #300
References #292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants