Skip to content

feat - fully handle multiple record constructors #16

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

Closed
mxyns opened this issue Mar 4, 2022 · 1 comment · Fixed by #18
Closed

feat - fully handle multiple record constructors #16

mxyns opened this issue Mar 4, 2022 · 1 comment · Fixed by #18
Assignees
Labels
enhancement New feature or request

Comments

@mxyns
Copy link
Collaborator

mxyns commented Mar 4, 2022

still need a way to select which constructor to use (either by using annotation or finding out which one to use depending on the bindings)

@mxyns mxyns added the enhancement New feature or request label Mar 4, 2022
@mxyns
Copy link
Collaborator Author

mxyns commented Mar 4, 2022

names of constructor parameters are dropped by compiler so for :

record TestRecord7(long val) {

    @JsonCreator
    public TestRecord7(int valInt) {
        this(Long.valueOf(valInt));
    }
}

The name valInt gets dropped by compiler and changed to arg0 so the binding for valInt is not found and class instanciation fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants