The analyzer has detected a label inside the switch statement that differs from the case or default clauses. This looks like a typo. As a result, the intended branch never executes.
Look at the example:
switch (status) {
case 1:
handleActive();
break;
case 2:
handlePending();
break;
defalt:
handleUnknown();
break;
}
The code looks like it should call handleUnknown for all status values besides 1 and 2. In fact, this will not happen, since defalt is an ordinary label rather than the default clause. The call to handleUnknown is unreachable for any status value.
The fixed code:
switch (status) {
case 1:
handleActive();
break;
case 2:
handlePending();
break;
default:
handleUnknown();
break;
}
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: