Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.0, 2.1.1
-
originally: Linux jato-rafal 3.0.0-31-generic #49-Ubuntu SMP Tue Feb 19 20:02:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
reproduced on Windows 7 x64
Description
This annotation:
@Retention(RetentionPolicy.RUNTIME) @Target([ElementType.TYPE, ElementType.METHOD]) @interface Tx { String value() default 'def' }
on this class:
@Tx public class PersonServiceJava { }
results in the following failure:
$ groovyc -j PersonServiceJava.java Tx.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Compile error during compilation with javac.
/home/wujek/Playground/annotation_test/src/main/groovy/test/PersonServiceJava.java:4: error: annotation Tx is missing value for the attribute value
@Tx
^
1 error
I originally submitted it to Gradle (http://issues.gradle.org/browse/GRADLE-2682), but it seems to be a core groovy issue. The generated stub for the Groovy annotation look like the following:
@java.lang.annotation.Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value={java.lang.annotation.ElementType.TYPE,java.lang.annotation.ElementType.METHOD}) public @interface Tx { java.lang.String value(); }
The default value is missing. A sample project can be downloaded in the Gradle issue, so I won't attach it here, unless you want me to.
Attachments
Issue Links
- is related to
-
GROOVY-7252 Integer literal not accepted for primitive short annotation attribute
- Closed