-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
generate hasFOO() for boolean fields named 'hasFOO' instead of 'isHasFOO' #77
Comments
👤 reinierz 🕗 Jul 24, 2009 at 04:17 UTC What steps will reproduce the problem?
Fix: If boolean field and the field name starts with 'has', use the field name as method name. |
👤 r.spilker 🕗 Jul 24, 2009 at 11:04 UTC Also, we might want to check if any of the is/has/get methods exists befor creating |
👤 r.spilker 🕗 Jul 25, 2009 at 21:10 UTC If the field starts with "is" we don't want to prepend another "is". We need to make |
👤 reinierz 🕗 Jul 26, 2009 at 07:19 UTC Implemented all suggested changes in commit a9d2989. NB: Roel, I haven't tested all borderline cases on this one! |
👤 reinierz 🕗 Jul 26, 2009 at 07:30 UTC Test ﹟1: Make boolean fields named 'isFoo', 'getBar', 'hasBaz' and 'hashFlooble'. This must generate methods On eclipse: Correct on all counts. On javac: Correct on all counts. Test ﹟2: Make boolean fields named 'isFoo', 'bar'. Then make methods named 'hasFoo', and 'getBar', and make on eclipse: correct on all counts. on javac: correct on all counts. Thus, I'm verifying the change. |
End of migration |
Sorry, I see that it's an old thread, but do I miss something or was it reverted? Because it generates |
@Ghedeon IIRC this has indeed been reverted. It makes the names sound better, but it's another "prefix-shedding", incompatible with javabeans and not very systematic. There (at least) following possibilities:
|
Why not give the developer the ability so set the exact getter/setter name they what to use? For instance I have a Boolean getter I would like to call canAdd... rather than isAdd or hadAdd. Something like the following would be nice: @Getter(name="canAdd") |
Migrated from Google Code (issue 4)
The text was updated successfully, but these errors were encountered: