Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Groovy 2.4.5
Description
When generating Java stub for enum with an abstract method results in invalid Java source. The generated source class is defined as "abstract enum".
EnumWithAbstractMethod.groovy
enum EnumWithAbstractMethod { ONE { @Override int getInt() { return 1 } }, TWO { @Override int getInt() { return 2 } } abstract int getInt() }
Driver.groovy
class Driver { public static void main(String[] args) { def stubCompiler = new JavaStubCompilationUnit( new CompilerConfiguration(), new GroovyClassLoader(), new File('tmp') ) stubCompiler.addSource(new File('EnumWithAbstractMethod.groovy')) stubCompiler.compile() } }
EnumWithAbstractMethod.java
public abstract enum EnumWithAbstractMethod implements groovy.lang.GroovyObject { ...