Files
openide/java/java-impl/resources/inspectionDescriptions/NullableProblems.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

32 lines
1.1 KiB
HTML

<html>
<body>
Reports problems related to nullability annotations.
<p><b>Examples:</b></p>
<ul>
<li>Overriding methods are not annotated:
<pre><code>
abstract class A {
@NotNull abstract String m();
}
class B extends A {
String m() { return "empty string"; }
}
</code></pre>
</li>
<li>Annotated primitive types: <code>@NotNull int myFoo;</code> </li>
<li>Both <code>@Nullable</code> and <code>@NotNull</code> are present on the same member: <code>@Nullable @NotNull String myFooString;</code></li>
<li>Collection of nullable elements is assigned into a collection of non-null elements:
<pre><code>
void testList(List&lt;@Nullable String> nullableList) {
List&lt;@NotNull String> list2 = nullableList;
}
</code></pre>
</li>
</ul>
<!-- tooltip end -->
<p>Use the <b>Configure Annotations</b> button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings.</p>
<p>This inspection only reports if the language level of the project or module is 5 or higher,
and nullability annotations are available on the classpath.</p>
</body>
</html>