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

Should not fail on abstract Collections for properties when using delegating Creator #2252

Closed
cowtowncoder opened this issue Feb 10, 2019 · 1 comment

Comments

@cowtowncoder
Copy link
Member

(note: follow-up for #2251)

So, it looks like something like this:

    static class DelegatingWithAbstractSetter
    {
        Map<String, Object> _stuff;

        @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
        public DelegatingWithAbstractSetter(Map<String, Object> stuff) {
            _stuff = stuff;
        }

        public void setNeverUsed(MyAbstractList bogus) { }
    }

fails with exception complaining that no deserializer can be found for abstract class MyAbstractList. Interestingly enough this is NOT problematic for simple abstract types (for which such code will not fail -- it either only fails for actual attempt at use, or something else is going on).
But since no setter or field would ever be used when there is a delegating creator, this is bogus problem, and should not cause failure.

Ideally Jackson would not even attempt resolution of setters when there is delegating creator.

@cowtowncoder
Copy link
Member Author

No plans to try to fix this: users should @JsonIgnore such properties.

@cowtowncoder cowtowncoder closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2024
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

1 participant