groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-7969) Incorrect modifers on setter for volatile property with @Bindable/@Vetoable
Date Wed, 01 Feb 2017 23:19:02 GMT

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

Paul King closed GROOVY-7969.
-----------------------------

> Incorrect modifers on setter for volatile property with @Bindable/@Vetoable
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-7969
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7969
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Assignee: Paul King
>             Fix For: 2.4.8
>
>
> As part of GROOVY-3726 we fixed getter/setter method modifiers for volatile (or transient)
properties. The @Bindable and @Vetoable transforms however generate their own setters and
bypass that fix.
> Here is a script to reproduce the problem:
> {code}
> import static java.lang.reflect.Modifier.toString
> import groovy.beans.Bindable
> class Foo {
>   volatile Date now
> }
> @Bindable class Bar {
>   volatile Date then
> }
> void pretty(int mod) { println "${mod.toString().padRight(10)}" + toString(mod) }
> pretty(Foo.getMethod('getNow').modifiers)
> pretty(Foo.getMethod('setNow', Date).modifiers)
> pretty(Bar.getMethod('getThen').modifiers)
> pretty(Bar.getMethod('setThen', Date).modifiers)
> {code}
> which currently produces:
> {noformat}
> 1         public
> 1         public
> 1         public
> 65        public volatile
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message