consider this commit https://github.com/checkstyle/checkstyle/pull/18580/changes
https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevel.java
private static String renderSeverityLevel(SeverityLevel severityLevel) {
return switch (severityLevel) {
case IGNORE -> "none";
case INFO -> "note";
case WARNING -> "warning";
case ERROR -> "error";
};
}
mutation:
<sourceFile>SarifLogger.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.SarifLogger</mutatedClass>
<mutatedMethod>renderSeverityLevel</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.ConstructorCallMutator</mutator>
<description>removed call to java/lang/MatchException::<init></description>
<lineContent>return switch (severityLevel) {</lineContent>
as this is Exhaustive switch, compiler do validation, is there a way to avoid mutation ?
consider this commit https://github.com/checkstyle/checkstyle/pull/18580/changes
https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevel.java
mutation:
as this is Exhaustive switch, compiler do validation, is there a way to avoid mutation ?