[ https://issues.apache.org/jira/browse/GROOVY-9726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-9726: -------------------------------- Fix Version/s: 2.5.16 > Compile error needed for illegal field modifier combination > ----------------------------------------------------------- > > Key: GROOVY-9726 > URL: https://issues.apache.org/jira/browse/GROOVY-9726 > Project: Groovy > Issue Type: Improvement > Affects Versions: 3.0.5, 2.5.13 > Reporter: Paul King > Assignee: Paul King > Priority: Major > Fix For: 4.0.0-alpha-1, 3.0.6, 2.5.16 > > > The JLS (recent versions at least) states: > {quote} > It is a compile-time error if a final variable is also declared volatile. > {quote} > Compiling this class: > {code} > public class Foo { > final volatile String foo = "bar"; > } > {code} > in Java gives the following compilation error: > {noformat} > error: illegal combination of modifiers: final and volatile > {noformat} > Groovy currently passes compilation but then gives the following error at > runtime when trying to create an instance of such a class: > {noformat} > java.lang.ClassFormatError: Illegal field modifiers in class Foo: 0x52 > {noformat} > Groovy should also have a compilation error for this case. -- This message was sent by Atlassian Jira (v8.20.1#820001)