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

18 lines
540 B
HTML

<html>
<body>
Reports <code>null</code> checks followed by a method call that will definitely return
<code>false</code> when <code>null</code> is passed (e.g. <code>Class.isInstance</code>).
<p>Such a check seems excessive as the method call will always return <code>false</code> in this case.</p>
<p><b>Example:</b></p>
<pre><code>
if (x != null && myClass.isInstance(x)) { ... }
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
if (myClass.isInstance(x)) { ... }
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>