Files
openide/java/java-impl/resources/inspectionDescriptions/ObviousNullCheck.html
2025-02-05 04:43:28 +00:00

17 lines
548 B
HTML

<html>
<body>
Reports if a null-checking method (for example, <code>Objects.requireNonNull</code> or <code>Assert.assertNotNull</code>) is
called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate
a programming error.
<p><b>Example:</b></p>
<pre><code>
final String greeting = Objects.requireNonNull("Hi!");
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
final String greeting = "Hi!";
</code></pre>
<!-- tooltip end -->
<p>New in 2017.2</p>
</body>
</html>