-
Notifications
You must be signed in to change notification settings - Fork 40
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
Boolean fields that start with a prefix and then "isXXX" will fail. #104
Comments
Works for me. |
@Yky could you give an example of the field name and getter name you are using? It should not work if you have something like and you can see in the generated method names code above, the method names this will produce are:
so you get |
… for boolean fields that start with a prefix followed by "is".
Why do you have the following line in your sample code.
My tests work without this. The only registered prefix I have is "m". |
When you have a boolean field that starts with with a prefix, followed by "is", openpojo will fail to find/associate its getter.
e.g.
boolean mIsDefault;
will try to find getters calledgetIsDefault
andisIsDefault
, but notisDefault
The issue is in
PojoMethodFactory.generateGetMethodNames
in this partthe first
prefix.add
will generate isIsDefault, the second prefix.add wont be executed because you are callingfieldName.startsWith
instead of AttributeHelper.getAttributeName(field).startsWith.You should also need add a toLower, making it
The text was updated successfully, but these errors were encountered: