'if' statement can be replaced with conditional or boolean expression
if statements that can be replaced with conditions using the
The result is usually shorter, but not always clearer, so it's not advised to apply the fix in every case.
After the quick-fix is applied:
Configure the inspection:
Use the Don't suggest '?:' operator option to disable the warning when the
?:operator is suggested. In this case, only
!=suggestions will be highlighted. The quick-fix will still be available in the editor.
Use the Ignore chained 'if' statements option to disable the warning for
if-elsechains. The quick-fix will still be available in the editor.
New in 2018.2
Don't suggest '?:' operator
Ignore chained 'if' statements
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3