[JSR308] Annotations in initialization code

Mahmood Ali mahmood at MIT.EDU
Tue Aug 18 10:31:07 EDT 2009


Thank you very much for reporting your observation, and I am terribly  
sorry if we hindered your research.

> [W]e were rather surprised to see that annotations for
> field initialization and instance initializers outside of a  
> constructor are
> placed on the field or enclosing class, rather than on the <init>  
> method.
> While this is consistent with the spec, it makes finding the possible
> annotations corresponding to a bytecode instruction in an  
> initializer method
> a little difficult.
Your observation and analysis are correct.  The spec is vague on this  
issue, and it is in our TODO list.

The javac does not handle field, instance, or static initialization  
well.  We will push a fix for this issue, as soon as we clarify the  


More information about the JSR308 mailing list