summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-findbugs-plugin
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-23 20:58:08 +0000
committerGodin <mandrikov@gmail.com>2010-11-23 20:58:08 +0000
commitdf9b58de719d0c6e8e696f2015de8ae903173fb3 (patch)
treeaad13a94926eda3c9e675bf38200e4d80a6b6987 /plugins/sonar-findbugs-plugin
parentb22bfd03b71f07eeab42a0ce34e589a42d0920c7 (diff)
downloadsonarqube-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')
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/profile-sonar-way-findbugs.xml3
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml12
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>