Community
Participate
Working Groups
An empty case at the end of the switch should be treated differently from an empty case preceding another case. It makes sense to show no warnings in the following code by default: switch (i) { case 1: case 2: // do something break; } but show a warning in: switch (i) { case 1: // do something break; case 2: }
It is smart enough so you can do it in "Customize" dialog for both but I agree that defaults should be as you pointed out. I had to modify our internal CDT installation to do that just the other day.
BTW the description for this problem in preferences ends with triple word "statement".
(In reply to comment #1) To clarify: The empty case preference should not apply to the last case, which should be governed exclusively by the last case preference.
3 bugs in one. So I fixed: - description text - property empty statement does not apply to last statement - default turn off empty stmt customization property added corresponding test cases
*** cdt cvs genie on behalf of elaskavaia *** Bug 333813 - fixed fp, default settings and description [*] CaseBreakCheckerTest.java 1.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java?root=Tools_Project&r1=1.2&r2=1.3 [*] CheckerTestCase.java 1.19 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java?root=Tools_Project&r1=1.18&r2=1.19 [*] bundle.properties 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/OSGI-INF/l10n/bundle.properties?root=Tools_Project&r1=1.7&r2=1.8 [*] messages.properties 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/messages.properties?root=Tools_Project&r1=1.11&r2=1.12 [*] CaseBreakChecker.java 1.2 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java?root=Tools_Project&r1=1.1&r2=1.2