IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Inferred annotations

Last modified: 10 August 2022

IntelliJ IDEA scans bytecode from SDKs and libraries and infers annotations automatically. These annotations can help you better understand code contacts and make code analysis more efficient.

IntelliJ IDEA infers the @Nullable and @NotNull annotations that you can use to analyze your source code to spot places where you overlooked null. For methods with more complex behavior, IntelliJ IDEA has the method contracts (@Contract). The IDE also infers @Unmodifiable and @UnmodifiableView annotations.

In the editor, inferred annotations are marked with the Inferred annotation icon icon in the gutter.

Inferred annotation in the editor