Type Annotations (JSR 308) and the Checker Framework

Contents:

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


What are type annotations?

Java's declaration annotation syntax is useful but limited. As of Java 8, Java's type annotation syntax permits annotations to be written 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.

The Java Language Specification (Java 8 or later) describes type annotations. An earlier version of 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 that were adopted in Java 8.


Download

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

More details and additional downloads appear below.


Support and community

If you have a question, then first see whether your question is answered in one of the manuals listed under Documentation below. If none of those documents answers your question, then use one of the mailing lists.

Documentation

Mailing lists

The mailing lists are appropriate for discussing the Type Annotations (JSR 308) specification, any tool that processes type annotations (compiler, the Checker Framework, the Annotation File Utilities, etc.), and any other issue related to type annotations. We welcome questions, bug reports, suggestions, reports about case studies, and other contributions. Let us know how we can make type annotations even better!

Bug reports

To submit a bug report, use the issue tracker for the relevant tool:


Last updated: September 2, 2020