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

when variable starts with single letter like gName, the getter & setter is wrong #1803

Closed
DarrenLuo opened this issue Aug 3, 2018 · 7 comments

Comments

@DarrenLuo
Copy link

DarrenLuo commented Aug 3, 2018

private String gName;

public String getGName() {
    return this.gName;
}

public void setGName(String gName) {
    this.gName = gName;
}

If I use ide auto generate, the result should be:

public String getgName() {
    return gName;
}

public void setgName(String gName) {
    this.gName = gName;
}
@qiangbro
Copy link

qiangbro commented Aug 9, 2018

image

@wrprice
Copy link

wrprice commented Aug 15, 2018

Dup of #757 ?

@janrieke
Copy link
Contributor

janrieke commented Aug 16, 2018

This has been discussed a few times. Summary: There is no clear "right" or "wrong" in this case, and changing lombok here will be a breaking change that will lead to compile errors in several projects when they upgrade the lombok version. So I think the answer is still "won't do"...

@DarrenLuo
Copy link
Author

@janrieke I know it, but eclipse and IDEA all auto generate like getgName(), when I use most of the IDE of JAVA, they do the same thing, so I think it's a convention in JAVA's world, I find the problem when I use mapstruct, the plugin also use getgName(), so the two plugins are conflict.
Maybe My title is not suitable, because my English is very pool.
"convention over configuration", so I think lombok should handle this problem, when people upgrade the version of lombok lead compile errors, lombok can give a configuration in the new version to transfer the first letter to uppercase, and ask the people who meet the error to use the configuration.

@randakar
Copy link

randakar commented Aug 16, 2018 via email

@projectlombok projectlombok deleted a comment from qiangbro Aug 20, 2018
@rzwitserloot
Copy link
Collaborator

Duplicate of #757 - we will not be fixing this.

@rzwitserloot
Copy link
Collaborator

Duplicate of #2693

@rzwitserloot rzwitserloot marked this as a duplicate of #2693 Jan 2, 2021
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

6 participants