Boolean type equals show warning about rule: java:S2159

  • Operating system: Windows 11 23H2
  • SonarLint plugin version: 10.12.0.79769
  • IntelliJ version:
    IntelliJ IDEA 2024.3 (Ultimate Edition)
    Build #IU-243.21565.193, built on November 13, 2024
    Runtime version: 21.0.5+8-b631.16 amd64 (JCEF 122.1.9)
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Toolkit: sun.awt.windows.WToolkit
    Windows 11.0
    GC: ZGC Cycles, ZGC Pauses
    Memory: 4096M
    Cores: 12
    Registry:
    run.processes.with.pty=false
    ide.experimental.ui=true
    i18n.locale=
    terminal.new.ui=true
    Kotlin: 243.21565.193-IJ
  • Programming language you’re coding in: Java
  • Is connected mode used: No
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:

Lombok version: 1.18.26, and the entity code is here:

@Setter
@Getter
@ToString(callSuper = true)
public class SchoolNotify extends BaseEntity {
    private Boolean isSpecial;
}

After recompiling the project, the warning disappeared… :joy:

Hey @shilohooo, you are right. Our Java analyzer relies on Bytecode to provide a more accurate analysis. If you don’t build the project, the analyzer might not find all the issues, such as in your case.

1 Like

Thanks, I got it:)

Super! If you enjoy SonarLint for IntelliJ, do not hesitate to leave a review on our marketplace page, it’s always appreciated :sonarlint: