You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "ARUNAVA SINHA (JIRA)" <ji...@apache.org> on 2018/11/14 06:25:00 UTC

[jira] [Created] (NETBEANS-1677) Proposed suggestion hint to prevent RuntimeException "error: the switch expression does not cover all possible input values."

ARUNAVA SINHA created NETBEANS-1677:
---------------------------------------

             Summary: Proposed suggestion hint to prevent  RuntimeException "error: the switch expression does not cover all possible input values."
                 Key: NETBEANS-1677
                 URL: https://issues.apache.org/jira/browse/NETBEANS-1677
             Project: NetBeans
          Issue Type: Improvement
            Reporter: ARUNAVA SINHA
            Assignee: ARUNAVA SINHA


enum Days {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY;
}

public static void demonstrateLackingCaseInSwitchExpression() 
{

int numLetters = switch (day) {
case MONDAY, SUNDAY -> {
break 6;
}
case TUESDAY -> 7;
case THURSDAY, SATURDAY -> 8;
case WEDNESDAY -> 9;
};
}

Runtime Exception :" the switch expression does not cover all possible input values."

Proposed new hint should  prevent this situation, it should suggest user if he/she missed to add default case or any enum value case.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists