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

False positives in collapsible if statements contained within switches

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Rules
    • Labels:
      None

      Description

      The following code triggers an issue whereas it should not:

      public void visitToken(Token token) {
        if (currentlyInExecSqlStatement) {
          switch (currentExecSqlPatternState) {
            case SELECT:
              if ("SELECT".equals(token.getValue())) {
                /* ... */
              }
              break;
            }
         }
      }
      

        Attachments

          Activity

            People

            Assignee:
            benzonico OLD - Nicolas Peru
            Reporter:
            dinesh.bolkensteyn Dinesh Bolkensteyn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: