Bug in SonarLint8.1.0.65508 for IntelliJ

Please provide

  • Operating system: win10
  • SonarLint plugin version: 8.1.0.65508
  • 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:
Before:

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

After:

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.

Cheers