Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
12.1
-
None
-
None
-
Java 15, Windows 10
Description
In some switch statements NetBeans displays a hint saying the assigned value is never used even though it is:
public final class SwitchAssignedValueNeverUsed { public enum E { A, B; } public static void main(final String[] args) { E e = E.A; String s; switch (e) { case A -> s = "a"; // Hint: The assigned value is never used case B -> s = "b"; default -> throw new AssertionError(e.name()); } System.out.println(s); } }