Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3570

Relax Rule S5411 for boxed booleans if there is a null-checked before

    Details

    • Type: False-Positive
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 6.14
    • Component/s: Rules
    • Labels:
      None

      Description

      A compliant solution:

      Boolean b = …;
      
      if ( b != null )
          doSometing( b ? “a” : “b” ); // Should be ok, now reports an issue
      

      Created from community feedback: https://community.sonarsource.com/t/java-s5411-boxed-booleans-are-ok-to-be-used-if-null-checked-before/32464

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dorian.burihabwa Dorian Burihabwa
                Reporter:
                margarita.nedzelska Margarita Nedzelska
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated: