Switches with 'case null:' should be exhaustive

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 17
    • Affects Version/s: 17
    • Component/s: tools
    • None
    • b31

        As noted here:
        https://mail.openjdk.java.net/pipermail/compiler-dev/2021-July/017505.html

        For switches like:
        void test(String s) {
          switch (s) {
            case null:
              break;
          }
        }

        javac should produce a compile-time error, as the switch is not exhaustive.

              Assignee:
              Jan Lahoda
              Reporter:
              Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: