-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Anonymous Map initialization does not serialize correctly. #762
Comments
This is working as designed. Anonymous classes cannot be deserialized & for symmetry we forbid serialization also. You should get the expected result if you hint the actual Map.class type. |
Ah so serialization is forbidden for anonymous classes in general, not just fields declared in anonymous classes! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a sample to demonstrate the issue:
Output:
Initializing the map with the code below works fine:
While the first method is obviously a wasteful way to initialize a map, is this serialization behaviour for anonymous initialization expected? If so, can you clarify why?
The closest reference I could find to this was #298, which is about fields in anonymous classes.
The text was updated successfully, but these errors were encountered: