mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
26 lines
857 B
HTML
26 lines
857 B
HTML
<html>
|
|
<body>
|
|
Reports unnecessary or overly complicated boolean expressions.
|
|
<p>Such expressions include <code>&&</code>-ing with <code>true</code>,
|
|
<code>||</code>-ing with <code>false</code>,
|
|
equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.</p>
|
|
<p>Example:
|
|
<pre><code>
|
|
<b>boolean</b> a = !(x && <b>false</b>);
|
|
<b>boolean</b> b = <b>false</b> || x;
|
|
<b>boolean</b> c = x != <b>true</b>;
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
<b>boolean</b> a = <b>true</b>;
|
|
<b>boolean</b> b = x;
|
|
<b>boolean</b> c = !x;
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
<p>Configure the inspection:</p>
|
|
Use the <b>Ignore named constants in determining pointless expressions </b> option to ignore named constants when determining if an expression is pointless.
|
|
<p>
|
|
|
|
</body>
|
|
</html> |