tighten checkstyle rules for switch statements

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@810179 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2009-09-01 19:12:50 +00:00
parent 5444ff3879
commit a3217e90b9
2 changed files with 25 additions and 0 deletions

View File

@ -78,6 +78,26 @@
<!-- Utility class should not be instantiated, they must have a private constructor -->
<module name="HideUtilityClassConstructor" />
<!-- Switch statements should be complete and with independent cases -->
<module name="FallThrough" />
<module name="MissingSwitchDefault" />
<!--
<module name="ConstantName" />
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true" />
<property name="ignoreSetter" value="true" />
</module>
<module name="DeclarationOrder" />
<module name="IllegalCatch" />
<module name="RedundantModifier" />
<module name="StringLiteralEquality" />
<module name="ModifierOrder" />
<module name="MultipleStringLiterals" />
<module name="MultipleVariableDeclarations" />
<module name="TodoComment" />
<module name="UnnecessaryParentheses" />
-->
</module>
<!-- Require package javadoc -->

View File

@ -22,6 +22,7 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.math.MathRuntimeException;
import org.apache.commons.math.random.RandomData;
import org.apache.commons.math.random.RandomDataImpl;
import org.apache.commons.math.random.RandomGenerator;
@ -208,6 +209,8 @@ public class NaturalRanking implements RankingAlgorithm {
case FIXED: // Record positions of NaNs
nanPositions = getNanPositions(ranks);
break;
default: // this should not happen unless NaNStrategy enum is changed
throw MathRuntimeException.createInternalError(null);
}
// Sort the IntDoublePairs
@ -354,6 +357,8 @@ public class NaturalRanking implements RankingAlgorithm {
ranks[iterator.next()] = f + i++;
}
break;
default: // this should not happen unless TiesStrategy enum is changed
throw MathRuntimeException.createInternalError(null);
}
}