diff options
author | Godin <mandrikov@gmail.com> | 2010-11-23 20:58:08 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-11-23 20:58:08 +0000 |
commit | df9b58de719d0c6e8e696f2015de8ae903173fb3 (patch) | |
tree | aad13a94926eda3c9e675bf38200e4d80a6b6987 /plugins/sonar-findbugs-plugin | |
parent | b22bfd03b71f07eeab42a0ce34e589a42d0920c7 (diff) | |
download | sonarqube-df9b58de719d0c6e8e696f2015de8ae903173fb3.tar.gz sonarqube-df9b58de719d0c6e8e696f2015de8ae903173fb3.zip |
SONAR-1979: Add missing FindBugs rule - Dead store due to switch statement fall through to throw
Diffstat (limited to 'plugins/sonar-findbugs-plugin')
2 files changed, 14 insertions, 1 deletions
diff --git a/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/profile-sonar-way-findbugs.xml b/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/profile-sonar-way-findbugs.xml index d3b7e6c9fd6..4de545b9191 100644 --- a/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/profile-sonar-way-findbugs.xml +++ b/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/profile-sonar-way-findbugs.xml @@ -38,6 +38,9 @@ <Bug pattern="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH"/> </Match> <Match> + <Bug pattern="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW"/> + </Match> + <Match> <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/> </Match> <Match> diff --git a/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml b/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml index f26445e2cc8..4f5be6190c2 100644 --- a/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml +++ b/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml @@ -4299,7 +4299,17 @@ public @NonNegative Integer example(@Negative Integer value) { to a switch fall through. It is likely that you forgot to put a break or return at the end of the previous case. </p>]]></description> - </rule> + </rule> + <rule key="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW" priority="CRITICAL"> + <name> + <![CDATA[Dead store due to switch statement fall through to throw]]></name> + <configKey><![CDATA[SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW]]></configKey> + <category name="Reliability"/> + <description><![CDATA[<p> + A value stored in the previous switch case is ignored here due to a switch fall through to a place where an exception is thrown. + It is likely that you forgot to put a break or return at the end of the previous case. + </p>]]></description> + </rule> <rule key="NM_CLASS_NAMING_CONVENTION" priority="MAJOR"> <name> <![CDATA[Class names should start with an upper case letter]]></name> |