mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-30 13:05:19 +00:00
Enable MissingSwitchDefault Checkstyle check (#5966)
This commit is contained in:
1 parent
023620625f
commit
74c73dd4ce
10 files changed
+24
-9
No files matched your search
@@ -269,6 +269,9 @@ public class QuotedStringTokenizer
|
||||
else
|
||||
_token.append(c);
|
||||
continue;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@ public class ListChangesCommand extends RunRangeCommand {
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Unknown format: " + format);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -126,9 +126,8 @@ public abstract class ConsoleAnnotator<T> implements Serializable {
|
||||
switch (all.size()) {
|
||||
case 0: return null; // none
|
||||
case 1: return cast(all.iterator().next()); // just one
|
||||
default: return new ConsoleAnnotatorAggregator<>(all);
|
||||
}
|
||||
|
||||
return new ConsoleAnnotatorAggregator<>(all);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2233,9 +2233,9 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
case FIXED :
|
||||
return new Summary(false, Messages.Run_Summary_BackToNormal());
|
||||
|
||||
default:
|
||||
return new Summary(false, Messages.Run_Summary_Unknown());
|
||||
}
|
||||
|
||||
return new Summary(false, Messages.Run_Summary_Unknown());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2086,6 +2086,8 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
|
||||
throw new IOException("Failed to compute SHA-1 of downloaded file, refusing installation");
|
||||
case NOT_PROVIDED:
|
||||
throw new IOException("Unable to confirm integrity of downloaded file, refusing installation");
|
||||
default:
|
||||
throw new AssertionError("Unknown verification result: " + result1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,10 @@ public class RegistryKey implements AutoCloseable {
|
||||
|
||||
case WINERROR.ERROR_SUCCESS:
|
||||
return lpData;
|
||||
|
||||
default:
|
||||
throw new JnaException(r);
|
||||
}
|
||||
throw new JnaException(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,6 +155,8 @@ public class RetainVariablesLocalRule implements EnvVarsFilterLocalRule {
|
||||
variablesRemoved.add(variableName);
|
||||
iterator.remove();
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Unknown process variables handling: " + processVariablesHandling);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,9 @@ public class JSONSignatureValidator {
|
||||
LOGGER.log(Level.INFO, "JSON data source '" + name + "' does not provide a SHA-512 content checksum or signature. Looking for SHA-1.");
|
||||
break;
|
||||
case OK:
|
||||
// fall through
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Unknown form validation kind: " + resultSha512.kind);
|
||||
}
|
||||
} catch (NoSuchAlgorithmException nsa) {
|
||||
LOGGER.log(Level.WARNING, "Failed to verify potential SHA-512 digest/signature, falling back to SHA-1", nsa);
|
||||
@@ -127,7 +129,9 @@ public class JSONSignatureValidator {
|
||||
return FormValidation.error("No correct_signature or correct_signature512 entry found in '" + name + "'.");
|
||||
}
|
||||
case OK:
|
||||
// fall through
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Unknown form validation kind: " + resultSha1.kind);
|
||||
}
|
||||
|
||||
if (warning!=null) return warning;
|
||||
|
||||
@@ -54,8 +54,8 @@ public enum IconType {
|
||||
case PLUGIN: {
|
||||
return resURL + "/plugin/" + url;
|
||||
}
|
||||
default:
|
||||
throw new AssertionError("Unknown icon type: " + this);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -454,6 +454,7 @@ THE SOFTWARE.
|
||||
<module name="CovariantEquals" />
|
||||
<module name="DefaultComesLast" />
|
||||
<module name="EqualsHashCode" />
|
||||
<module name="MissingSwitchDefault" />
|
||||
<module name="NoEnumTrailingComma" />
|
||||
<module name="OneStatementPerLine" />
|
||||
<module name="PackageDeclaration" />
|
||||
|
||||
Reference in new issue
Block a user