dennis lucero created NETBEANS-4829:
---------------------------------------
Summary: Incorrect hint about unused assigned value in switch
statement
Key: NETBEANS-4829
URL: https://issues.apache.org/jira/browse/NETBEANS-4829
Project: NetBeans
Issue Type: Bug
Components: java - Hints
Affects Versions: 12.1
Environment: Java 15, Windows 10
Reporter: dennis lucero
In some switch statements NetBeans displays a hint saying the assigned value is
never used even though it is:
{code:java}
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);
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists