Type Annotations (JSR 308) and the Checker Framework

Contents:

For the impatient: Download and use pluggable type-checkers now.


What are type annotations?

The Java 5 annotation syntax is useful but limited. The Type Annotations language feature permits annotations to appear in more places, such as generic type arguments: List<@NonNull Object>. Programmers can use type annotations to write more informative types, and then tools such as type-checkers can detect and prevent more errors.

Type annotations are planned to be part of the Java 7 language. However, you can use them now by downloading our free, open-source tools. They are completely backward-compatible, so you can gain the benefits of type annotations while working with people who are using other versions of Java, such as Java 6, 5, or even 4.

The Type Annotations Specification (also known as "JSR 308") is available below. It describes the minor, backward-compatible changes to the Java language and classfile format. An implementation is publicly available, along with tools that use the annotations to find and prevent bugs.


Download

Most users only need to download the Checker Framework. Just follow the Installation instructions and tutorial.

More details and additional downloads appear below.


Community and getting help

This is the place to look if you need help, or if you want to give help. We welcome questions, bug reports, suggestions, and other contributions. Let us know how we can make type annotations even better!

If you need help, then first see whether your question is answered in one of the following documents:

If none of those documents answers your question, then use one of these mailing lists. They are appropriate for discussing the Type Annotations specification, any tool that processes type annotations (compiler, the Checker Framework, the Annotation File Utilities, etc.), and any other issue related to type annotations.

You can also use the mailing lists to give help. Here are just a few examples:

Another way to help is to tell your friends and colleagues about the usefulness and practicality of type annotations, or to report your successes to the mailing lists.


Last updated: June 17, 2009