Unnecessary parentheses
Reports any instance of unnecessary parentheses.
Parentheses are considered unnecessary if the evaluation order of an expression remains unchanged after you remove the parentheses.
Example:
int n = 3 + (9 * 8);
After quick-fix is applied:
int n = 3 + 9 * 8;
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
UnnecessaryParentheses
Configure the inspection:
Use the Ignore clarifying parentheses option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an
instanceof
expression that is a part of a larger expression or has a different operator than the parent expression.Use the Ignore parentheses around the condition of conditional expressions option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses.
Use the Ignore parentheses around single no formal type lambda parameter option to ignore parentheses around a single lambda parameter within a lambda expression.
Here you can find the description of settings available for the Unnecessary parentheses inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!