Exclude SF_SWITCH_NO_DEFAULT on FastDateParser

FastDateParser#simpleQuote uses a switch case that actually has a
default branch in it, but doesn't use break statements.

SF_SWITCH_NO_DEFAULT unfortunately cannot recognize this pattern, and
leave us with no choice but to suppress it.
This commit is contained in:
Allon Mureinik 2017-04-01 12:18:53 +03:00 committed by pascalschumacher
parent 3304965840
commit c40dcf6598
1 changed files with 6 additions and 1 deletions

View File

@ -139,9 +139,14 @@
<Method name="insertFormats" />
<Bug pattern="SF_SWITCH_NO_DEFAULT" />
</Match>
<!-- Reason: FindBugs does not 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.FastDateParser"/>
<Method name="getStrategy" />
<Or>
<Method name="getStrategy" />
<Method name="simpleQuote" params="java.lang.StringBuilder, java.lang.String"/>
</Or>
<Bug pattern="SF_SWITCH_NO_DEFAULT" />
</Match>