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] @Data won't generate getter and setters when two field have similar names #3342

Closed
BasZhang opened this issue Feb 3, 2023 · 1 comment

Comments

@BasZhang
Copy link

BasZhang commented Feb 3, 2023

Demo code is here:
`import lombok.Data;

@ Data
public class CC {

private DT data;

@Data
public static class DT {

    private Info info;

    @Data
    public static class Info {

        private String bitrate;
        private String bitRate;
    }
}

public static void main(String[] args) {
    var sut = new CC();
    sut.getData().getInfo().setBitrate(sut.getData().getInfo().getBitRate());
}

}
`

It has no warning when I type it in IDE, but It won't compile with Maven or Gradle. Maybe because the two fields have similar names.
I tried Lombok version 1.18.24 and 1.18.26.

@dstango
Copy link

dstango commented Feb 3, 2023

Duplicate of #2130

@Rawi01 Rawi01 closed this as completed May 10, 2023
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

3 participants