[
https://issues.apache.org/jira/browse/RATIS-1649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17796122#comment-17796122
]
Nandakumar commented on RATIS-1649:
-----------------------------------
In case of {{{}PurejavaCrc32C.java{}}}, the reported {{SF_SWITCH_NO_DEFAULT}}
is false positive.
{quote}
*Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT)*
This method contains a switch statement where default case is missing. Usually
you need to provide a default case.
Because the analysis only looks at the generated bytecode, this warning can be
incorrect triggered if the default case is at the end of the switch statement
and the switch statement doesn't contain break statements for other cases.
{quote}
We get the warning because of the missing break statements, not because of the
missing {{default}} case.
> Fix SF_SWITCH_NO_DEFAULT in PureJavaCrc32C
> ------------------------------------------
>
> Key: RATIS-1649
> URL: https://issues.apache.org/jira/browse/RATIS-1649
> Project: Ratis
> Issue Type: Sub-task
> Components: util
> Reporter: Tsz-wo Sze
> Assignee: Nandakumar
> Priority: Major
>
> - ./ratis-common/src/main/java/org/apache/ratis/util/PureJavaCrc32C.java -----
> {code}
> 23: import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
> 54: @SuppressFBWarnings("SF_SWITCH_NO_DEFAULT")
> 2 occurrence(s)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)