[JSR308] help on a simple example

Florin Bratu kreathorex at gmail.com
Tue Oct 28 07:52:39 EDT 2008


Hello everyone!

This is a simple question on the usage of the JSR308 prototype
implementation already available on the website. I've downloaded and
installed it over the OpenJDK 7 distribution. javac now recognises
annotations in comments, like this:

/*@Annotation*/
public class Main { }

but I'm not able to make it recognize annotations on "general" statements,
for instance this example, given on the website, does not work:

List<@Annotation Object> objs;

I am using the same annotation processor for @Annotation, and the same javac
version while compiling. Any ideas why the latter case is not recognized?

Also, regarding the annotations in comments. On the website, it is specified
that "This temporary mechanism will not be part of the official Java
language when JSR 308 is incorporated into it. It may or may not continue to
be supported by the javac compiler." Is this the official position of Sun? I
ask because I am working on a project where it would be really useful if the
feature will be included directly in the compiler - and not to write a
separate Java source code checker for annotations in comments....

Thank you!
Florin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.csail.mit.edu/pipermail/jsr308/attachments/20081028/f844fc74/attachment.htm 


More information about the JSR308 mailing list