Eclipse: Warn on incomplete switch cases even when default exists
We already have the warning "Incomplete 'switch' cases on enum" enabled, but it does not warn when a case is missing if the switch has a default block. Enable the "Signal even if 'default' case exists" option. This would have enabled us to catch the problem that was fixed in Ied8ff0f8f. In most instances of the warning we can simply add the missing case(s) above the 'default', meaning there is no change in behaviour. However there are some instances where the missing case is a bug and should be handled correctly. These are fixed separately in follow-up commits. Change-Id: I3675d29981423043266a26b1a78932c5708a6272
This commit is contained in:
@@ -323,6 +323,15 @@ public abstract class VersionedMetaData {
|
||||
case FORCED:
|
||||
update.fireGitRefUpdatedEvent(ru);
|
||||
return;
|
||||
case FAST_FORWARD:
|
||||
case IO_FAILURE:
|
||||
case LOCK_FAILURE:
|
||||
case NEW:
|
||||
case NOT_ATTEMPTED:
|
||||
case NO_CHANGE:
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
default:
|
||||
throw new IOException("Cannot delete " + ru.getName() + " in "
|
||||
+ db.getDirectory() + ": " + ru.getResult());
|
||||
@@ -391,6 +400,14 @@ public abstract class VersionedMetaData {
|
||||
revision = rw.parseCommit(ru.getNewObjectId());
|
||||
update.fireGitRefUpdatedEvent(ru);
|
||||
return revision;
|
||||
case FORCED:
|
||||
case IO_FAILURE:
|
||||
case LOCK_FAILURE:
|
||||
case NOT_ATTEMPTED:
|
||||
case NO_CHANGE:
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
default:
|
||||
throw new IOException("Cannot update " + ru.getName() + " in "
|
||||
+ db.getDirectory() + ": " + ru.getResult());
|
||||
|
||||
Reference in New Issue
Block a user