Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.8-beta-1
-
None
Description
This code...
import java.lang.annotation.* @Retention(RetentionPolicy.Runtime) // should be 'RUNTIME' @interface MyAnn { String foo() }
... produces the following groovyc error message:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during class generation: No enum const class java.lang.annotation.RetentionPolicy.Runtime java.lang.IllegalArgumentException: No enum const class java.lang.annotation.RetentionPolicy.Runtime at java.lang.Enum.valueOf(Enum.java:196) at java.lang.annotation.RetentionPolicy.valueOf(RetentionPolicy.java:19) at org.codehaus.groovy.vmplugin.v5.Java5.configureAnnotationFromDefinition(Java5.java:186) at org.codehaus.groovy.vmplugin.v5.Java5.configureAnnotation(Java5.java:209) at org.codehaus.groovy.classgen.AnnotationVisitor.visit(AnnotationVisitor.java:76) at org.codehaus.groovy.classgen.ExtendedVerifier.visitAnnotation(ExtendedVerifier.java:153) at org.codehaus.groovy.classgen.ExtendedVerifier.visitAnnotations(ExtendedVerifier.java:114) at org.codehaus.groovy.classgen.ExtendedVerifier.visitClass(ExtendedVerifier.java:51) at org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:736) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:971) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:497) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:474) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:458) at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:57) at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:170) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:138) at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:152) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130) 1 error
Might be better to show the user sth. other than an IllegalArgumentException (which looks like a compiler crash).