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

Serializer for widget types can't handle anonymous subclasses #6344

Closed
jpallas opened this issue Nov 18, 2017 · 0 comments
Closed

Serializer for widget types can't handle anonymous subclasses #6344

jpallas opened this issue Nov 18, 2017 · 0 comments

Comments

@jpallas
Copy link
Contributor

jpallas commented Nov 18, 2017

Many of the serializers set the "type" field by calling Class.getSimpleName(). This fails if the object being serialized is an instance of an anonymous subclass. Anonymous subclasses may be used in Java and Scala idioms to support terse initialization, such as

new Points() {{
    setX(xValues);
    setY(yValues);
    setColor(Color.RED);
    setOutlineColor(Color.BLUE);
    setSize(20);
}}

Walking up the class chain to find the first class that is neither anonymous nor inner addresses the problem.

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