RFC: Enable Eclipse warning about fall-through cases in switch statements

Enable the "'switch' case fall-through" warning in Eclipse to catch
unintentional fall-through to the following 'case' block when a 'break'
statement is omitted.

All warnings raised in the current codebase are caused by intentional
fall-throughs, so add "//$FALL-THROUGH$" comments to suppress those
warnings.

This change was inspired by the coverity report [1] which found the
problem in PutConfig (see CID 19880) but interestingly did not report
anything for the other ones.

RFC because I'm not sure if the "//$FALL-THROUGH$" comments will cause
the warnings to be suppressed on subsequent coverity scans.

[1] https://scan.coverity.com/projects/4032

Change-Id: Iad003bd7d086c67cccdbfb1312c8bd82d17fcc57
This commit is contained in:
David Pursehouse
2015-02-03 12:17:49 +09:00
parent 6404f30051
commit 9bbffa71b3
5 changed files with 5 additions and 1 deletions

View File

@@ -253,6 +253,7 @@ public class PutConfig implements RestModifyView<ProjectResource, Input> {
"The value '%s' is not permitted for parameter '%s' of plugin '"
+ pluginName + "'", value, v.getKey()));
}
//$FALL-THROUGH$
case STRING:
cfg.setString(v.getKey(), value);
break;