Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A boolean property should be able to have two getters: isX() and getX() #906
Groovy object properties follow the javabean spec for boolean, which allows for both a get* and an is* method to appear on the same object. Mybatis complains this doesn't follow the javabean spec which isn't entirely true. I know you can use Boolean to get around the get/is issue or define your own getter which stops groovy from building the pair, but the strange part is that this field is not even used by mybatis, its just a helper boolean internal to the object, but mybatis still validates the entire object whether the field is used or not in a resultmap.
could this rule be relaxed to allow the official javabean spec to not throw an error?
8.3.2 Boolean properties
heres the code in question that throws the error on a valid javabean.
changed the title from
Groovy POGO with boolean field
A boolean property should be able to have two getters: isX() and getX()
Feb 2, 2017
Thank you for the report, @admxiii !
I have committed the fix.
For future reference, here is the stack trace: