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

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>