[pmd-devel] Missing Break in Switch - existing test case questions
A source code analyzer
Brought to you by:
adangel,
juansotuyo
From: Andreas D. <ad...@us...> - 2012-05-27 15:07:52
|
Hi guys, I'm trying to fix this bug: http://sourceforge.net/tracker/?func=detail&aid=3496028&group_id=56262&atid=479921 I've found a solution, but this would break an existing test case: <test-code> <description><![CDATA[ one break ]]></description> <expected-problems>0</expected-problems> <code><![CDATA[ public class Foo { void main() { switch(i) { case 1: case 2: break; default: } } } ]]></code> </test-code> Does anyone remember, why we don't expect a problem here? It has two cases and one default case (so in sum 3 cases) but only one break... Or did we interpret this as an intentional fall-through, as there is no statement between case 1 and 2? Regards, Andreas |