Java type annotations (JSR 308): Early Draft Review

22 views
Skip to first unread message

Michael Ernst

unread,
Feb 11, 2012, 1:18:57 PM2/11/12
to jsr308-discuss
The type annotations specification ("JSR 308") is in Early Draft Review;
see http://jcp.org/aboutJava/communityprocess/edr/jsr308/index2.html .
This is a formal opportunity for the public to comment on the proposed
specification, so that it can be improved before being incorporated in the
Java language. Of course, such comments have always been accepted at this
mailing list as well.

As background, Oracle has announced that they intend to include, in JDK 8,
support for type annotations. Java 7 only permits annotations, such as
@Deprecated or @Override, to be written on declarations. The ability to
write annotations on type uses enables improved documentation and bug
detection. One example use is the Checker Framework for pluggable
typechecking (http://types.cs.washington.edu/checker-framework/). Note
that the Checker Framework is a third-party tool and not part of the Java
language proper, and other tools will also use JSR 308.

-Mike

Hero Wanders

unread,
Feb 14, 2012, 8:01:25 AM2/14/12
to jsr308-...@googlegroups.com
In chapter B (page 23) of the draft from 2012-01-23 I have found:

catch ( @A | @B NullPointerException | @C IllegalArgumentException e) {

An annotation before the first | is treated as applying to every disjunct, so the above
would be equivalent to (but shorter than)

catch ( @A | @B NullPointerException | @C IllegalArgumentException e) {

The last line should probably replaced by the following:
catch (@A @B NullPointerException | @A @C IllegalArgumentException e) {

This is of course a very minor issue but perhaps you want to fix it in the next revision.

With best regards
Hero Wanders

Michael Ernst

unread,
Feb 14, 2012, 11:49:15 AM2/14/12
to jsr308-...@googlegroups.com, hero.w...@arcor.de
Hero-

Thanks for spotting this typo!

I have corrected it, in this changeset:
http://code.google.com/p/jsr308-langtools/source/detail?r=7c235e6d3deaf46392f579df7be971100528c63a

-Mike
Reply all
Reply to author
Forward
0 new messages