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

29 lines
1.1 KiB
HTML

<html>
<body>
Reports <code>if</code> statements that can be replaced with conditions using the <code>&&</code>, <code>||</code>,
<code>==</code>, <code>!=</code>, or <code>?:</code> operator.
<p>The result is usually shorter, but not always clearer, so it's not advised to apply the fix in every case.</p>
<p>Example:</p>
<pre><code>
if (condition) return true; else return foo;
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
return condition || foo;
</code></pre>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<ul>
<li>
Use the <b>Don't suggest '?:' operator</b> option to disable the warning when the <code>?:</code> operator is suggested. In this case, only
<code>&&</code>, <code>||</code>, <code>==</code>, and <code>!=</code> suggestions will be highlighted. The
quick-fix will still be available in the editor.
</li>
<li>
Use the <b>Ignore chained 'if' statements</b> option to disable the warning for <code>if-else</code> chains. The quick-fix will
still be available in the editor.
</li>
</ul>
<p><small>New in 2018.2</small></p>
</body>
</html>