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

[BUG] @NoArgsConstructor on builder class doesn't work. #3126

Open
rzwitserloot opened this issue Mar 1, 2022 · 0 comments
Open

[BUG] @NoArgsConstructor on builder class doesn't work. #3126

rzwitserloot opened this issue Mar 1, 2022 · 0 comments

Comments

@rzwitserloot
Copy link
Collaborator

Describe the bug

This code:

@Builder
public class Data {
    @NoArgsConstructor
    public static class DataBuilder {
    }
}

fails to compile, as lombok's builder code generates a private constructor, and the XArgsConstructor code generates a public one. 2 identical explicit constructors, thus, compiler error.

Expected behavior

The noArgsConstructor should 'win' - the builder code needs to not just check for explicitly written constructors in the class, it also needs to check for XArgsConstructor annotations. Alternatively, the ordering should be adjusted so that the XArgsConstructor processor always runs first, which probably solves all problems just the same.

Related issue: Issue #2768

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