[ 
https://issues.apache.org/jira/browse/GROOVY-8463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniil Ovchinnikov resolved GROOVY-8463.
----------------------------------------
    Resolution: Duplicate

> Inconsistency: setter imported with getter alias
> ------------------------------------------------
>
>                 Key: GROOVY-8463
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8463
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Daniil Ovchinnikov
>            Priority: Major
>
> {code:java|title=com/foo/Bar.groovy}
> class Bar {
>   static def myProperty = 'hello'
> }
> {code}
> {code:java|title=bugs.groovy}
> import com.foo.Bar
> import static com.foo.Bar.setMyProperty as getAbc
> println Bar.@myProperty // as expected: 'hello'
> abc // -> getAbc() -> getAbc(null) -> setMyProperty(null)
> println Bar.@myProperty // expected: null, actual: 'hello', field value was 
> not updated
> getAbc() // -> getAbc(null) -> setMyProperty(null)
> println Bar.@myProperty // as expected: null, field was updated to null
> getAbc(42) // -> setMyProperty(42)
> println Bar.@myProperty // as expected: 42, field was updated to 42{code}
> {{abc}} should call setter as explicit {{getAbc()}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to