Contents:
For the impatient: Download and use pluggable type-checkers now.
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.
Most users only need to download the Checker Framework. Just follow the Installation instructions and tutorial.
More details and additional downloads appear below.
.java
and .class
files.
It also provides a representation (called
an “annotation file”) for annotations that is outside the source code or
the .class
file. The tools support both Java 5
annotations, and the type annotations defined in JSR 308.
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.
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!
To submit a bug report, use the issue tracker for the relevant tool:
Last updated: September 2, 2020