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

30 lines
1.2 KiB
HTML

<html>
<body>
Reports any instance of unnecessary parentheses.
<p>Parentheses are considered unnecessary if the evaluation order of an expression remains
unchanged after you remove the parentheses.</p>
<p>Example:</p>
<pre><code>
int n = 3 + (9 * 8);
</code></pre>
<p>After quick-fix is applied:</p>
<pre><code>
int n = 3 + 9 * 8;
</code></pre>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Ignore clarifying parentheses</b> option to ignore parentheses that help clarify a binary
expression. Parentheses are clarifying if the parenthesized expression is an
<code>instanceof</code> expression that is a part of a larger expression or has a different operator than the parent expression.</li>
<li>Use the <b>Ignore parentheses around the condition of conditional expressions</b> option to ignore any
parentheses around the condition of conditional expressions. Some coding standards specify that all such
conditions must be surrounded by parentheses.</li>
<li>
Use the <b>Ignore parentheses around single no formal type lambda parameter</b> option to ignore parentheses
around a single lambda parameter within a lambda expression.
</li>
</ul>
</body>
</html>