mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
32 lines
1.1 KiB
HTML
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<@Nullable String> nullableList) {
|
|
List<@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>
|