[ https://issues.apache.org/jira/browse/GROOVY-10928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-10928. ------------------------------ > Invalid stub code for interface field > ------------------------------------- > > Key: GROOVY-10928 > URL: https://issues.apache.org/jira/browse/GROOVY-10928 > Project: Groovy > Issue Type: Bug > Components: Stub generator / Joint compiler > Affects Versions: 4.0.8 > Reporter: Christopher Smith > Assignee: Eric Milles > Priority: Major > Fix For: 3.0.16, 4.0.10 > > > When compiling this interface: > {code:groovy} > @CompileStatic > interface Service { > TypeReference<Map<String, Object>> STATE_TYPE_MAP = new > TypeReference<Map<String, Object>>(){} > } > {code} > the stub generator produces code that does not compile under Java 11: > {code:java} > @groovy.transform.CompileStatic() public interface Service > <T> { > ; > com.fasterxml.jackson.core.type.TypeReference<java.util.Map<java.lang.String, > java.lang.Object>> STATE_TYPE_MAP; > static { STATE_TYPE_MAP = null; } > {code} > {code} > [ERROR] Service.java:[6,112] = expected > [ERROR] Service.java:[7,8] initializers not allowed in interfaces > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)