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

Handle Java 12 new switch expression

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.12
    • Component/s: Parser, Semantic
    • Labels:
      None

      Description

      Java 12 introduces the a new Switch Expression, with a new syntax:

      switch (day) {
          case MONDAY, FRIDAY, SUNDAY -> System.out.println(6);
          case TUESDAY                -> System.out.println(7);
          case THURSDAY, SATURDAY     -> System.out.println(8);
          case WEDNESDAY              -> System.out.println(9);
      }
      

      SonarJava should be able to parse it and semantically understand it.

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              michael.gumowski Michael Gumowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: