Bug in SonarLint8.1.0.65508 for IntelliJ

Please provide

  • Operating system: win10
  • SonarLint plugin version:
  • Programming language you’re coding in: java
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:
Not automatically adding parentheses when merging two ifs, resulting in logical errors.
For example:

if (true || false){
  if(false) {


if (true || false && (false)) {

It should be:

if ((true || false) && (false)) {

Thank you Fan for reporting this bug. I created SONARJAVA-4480 to address the issue.