Combined if statements (PMD).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1422354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2012-12-15 20:59:01 +00:00
parent 99155e564c
commit 1e40f1f36c
1 changed files with 3 additions and 5 deletions

View File

@ -353,11 +353,9 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* not equal to {@link #INFINITE_WINDOW}
*/
public void setWindowSize(int windowSize) throws MathIllegalArgumentException {
if (windowSize < 1) {
if (windowSize != INFINITE_WINDOW) {
throw new MathIllegalArgumentException(
LocalizedFormats.NOT_POSITIVE_WINDOW_SIZE, windowSize);
}
if (windowSize < 1 && windowSize != INFINITE_WINDOW) {
throw new MathIllegalArgumentException(
LocalizedFormats.NOT_POSITIVE_WINDOW_SIZE, windowSize);
}
this.windowSize = windowSize;