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

FP S2589 when Boolean variable doesn't always evaluate to TRUE/FALSE

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.10
    • Component/s: Symbolic Execution
    • Labels:
      None

      Description

      public void foo()
      {
          Boolean b = ...;
          if ( b == Boolean.TRUE )
              doSomething();
          else if ( b == Boolean.FALSE ) // FP
              doSomethingElse();
      }
      
      public void foo(Boolean b)
      {
          if ( b == Boolean.TRUE )
              doSomething();
          else if ( b == Boolean.FALSE ) // FP
              doSomethingElse();
      }
      

      Created from the community feedback

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              margarita.nedzelska Margarita Nedzelska
              Reporter:
              margarita.nedzelska Margarita Nedzelska
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: