Exclude SF_SWITCH_NO_DEFAULT on FastDatePrinter FastDatePrinter#appendFullDigits uses a switch case without break statements.
SF_SWITCH_NO_DEFAULT unfortunately cannot recognize this pattern, and leave us with no choice but to suppress it. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/8069e1c1 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/8069e1c1 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/8069e1c1 Branch: refs/heads/release Commit: 8069e1c1ce7ec864c7bab2eae880742fac02376b Parents: 4d343cc Author: Allon Mureinik <amure...@redhat.com> Authored: Sat Apr 1 12:18:53 2017 +0300 Committer: pascalschumacher <pascalschumac...@gmx.net> Committed: Wed Apr 19 18:24:57 2017 +0200 ---------------------------------------------------------------------- findbugs-exclude-filter.xml | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/8069e1c1/findbugs-exclude-filter.xml ---------------------------------------------------------------------- diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml index edc6ead..23dddbd 100644 --- a/findbugs-exclude-filter.xml +++ b/findbugs-exclude-filter.xml @@ -150,6 +150,14 @@ <Bug pattern="SF_SWITCH_NO_DEFAULT" /> </Match> + <!-- Reason: FindBugs cannot correctly recognize default branches in switch statements without break statements. + See, e.g., the report at https://sourceforge.net/p/findbugs/bugs/1298 --> + <Match> + <Class name="org.apache.commons.lang3.time.FastDatePrinter"/> + <Method name="appendFullDigits" params="java.lang.Appendable, int, int"/> + <Bug pattern="SF_SWITCH_NO_DEFAULT" /> + </Match> + <!-- Reason: The fallthrough on the swich stateme is intentional --> <Match> <Class name="org.apache.commons.lang3.time.FastDatePrinter"/>