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

FP in S6205 when the content of the block is not an expression

    XMLWordPrintable

    Details

      Description

      When the content of the block in a case "with arrow" is not an expression, it is not possible to remove the block.

          switch (mode) {
            case "a" -> { // FP
              return 1;
            }
            case "b" -> { // FP
              if (result == 1) {
                doSomethingElse();
              }
            }
            default -> doSomethingElse();
          }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chrislain.razafimahefa Chrislain Razafimahefa
              Reporter:
              quentin.jaquier Quentin Jaquier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: