]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1979: Add missing FindBugs rule - Dead store due to switch statement fall throu...
authorGodin <mandrikov@gmail.com>
Tue, 23 Nov 2010 20:58:08 +0000 (20:58 +0000)
committerGodin <mandrikov@gmail.com>
Tue, 23 Nov 2010 20:58:08 +0000 (20:58 +0000)
plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/profile-sonar-way-findbugs.xml
plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml

index d3b7e6c9fd680d3ebeaa09e35eaf7d14aaefbe44..4de545b9191d18acd4fd936f6163b4814ed65136 100644 (file)
@@ -37,6 +37,9 @@
   <Match>
     <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>
index f26445e2cc885f53bd8125044ce056aac26ad6a7..4f5be6190c28cc0705f699b80aeed362ea02bbff 100644 (file)
@@ -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>