Annotations are lost #13

Closed
pniederw opened this Issue Aug 8, 2009 · 3 comments

Comments

Projects
None yet
1 participant

pniederw commented Aug 8, 2009

Annotations with runtime retention are not available at runtime. Example:

@Deprecated
class Foo {
  @Deprecated
  def foo() {}
}

assert Foo.class.getAnnotations().size() > 0 // fails
assert Foo.class.getMethod("foo", null).getAnnotations().size() > 0 // fails

Annotations shipping with Groovy are also affected. There might be a bigger problem here, because the old/new Groovy Eclipse plugin has the same problem (even though not 100% reproducible). When inspecting the class files produced by the Groovy Eclipse plugin, I found that the annotations aren't even in the class files.

pniederw commented Aug 9, 2009

gaelyk has the same problem. All annotations on dynamically compiled Groovy code are lost.

pniederw commented Aug 9, 2009

Also, annotation defaults don't work. If an annotation default is not overridden, a compile error occurs.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment