[ https://issues.apache.org/jira/browse/GROOVY-10462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17479816#comment-17479816 ]
Eric Milles commented on GROOVY-10462: -------------------------------------- This has already been fixed in Groovy 4. Boolean will only generate getter and boolean will only generate isser. > Groovy should not generate both `getFlag` and `isFlag` for a Boolean field. > --------------------------------------------------------------------------- > > Key: GROOVY-10462 > URL: https://issues.apache.org/jira/browse/GROOVY-10462 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 3.0.9 > Reporter: Xiaoguang Wang > Priority: Critical > > Before, Groovy 2 only generates one getter for a Boolean field. > But now Groovy 3 generates two, it breaks some ORM frameworks (ex: MyBatis, > it can not decide which getter to be used) and breaks JSON output. > And the meaning of `isFlag` is wrong, it should not return `Boolean` in my > mind. > > {code:java} > @CompileStatic > class Foo { > Boolean flag > static void main(String[] args) { > Foo foo = new Foo() > println(foo.getFlag()) > println(foo.isFlag()) // should not generate the `isFlag` getter > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)