groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul King <>
Subject Re: Wrong bytecode generated for getters and setters of volatile field
Date Tue, 11 Oct 2016 11:54:39 GMT
This is a bug in Groovy. Normally for a property those modifier bits
are cleared:

But for @Bindable it creates its own setters and bypass the above logic:

The same will be true for @Vetoable:

I created the following issue to track the problem:

Cheers, Paul.

On Tue, Oct 11, 2016 at 7:34 PM, Nicolas Peru
<> wrote:
> Hi,
> I am the developer of the SonarQube Java Analyzer.
> While we are doing an analysis we are reading bytecode of external
> dependencies of the compilation unit analyzed.
> A user recently came back on SonarQube google group complaining about a
> failure on one of the invariant we have in our bytecode analysis where a
> bridge method was not marked as synthetic.
> Investigating a bit further it appears that the failing method is a getter
> generated by groovy compiler and that it is indeed (wrongly) marked as
> bridge because it is the same bit as the one used for volatile for fields.
> This is an issue that is supposed to be solved  a long time ago per :
> A reproducer of this issue can be found by compiling the following project :
> and looking at the generated
> .class files.
> Related discussion about this specific problem on SonarQube Google groups:
> as I am no Groovy expert, can anyone shed a light on this ? It sounds to me
> like there is still a bug on Groovy side on this but I might be wrong.
> Thanks for your help.
> --
> Nicolas PERU | SonarSource
> Senior Developer

View raw message