Xiaoguang Wang created GROOVY-10462:
---------------------------------------

             Summary: 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


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)

Reply via email to