You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2012/12/15 21:59:02 UTC
svn commit: r1422354 -
/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.java
Author: psteitz
Date: Sat Dec 15 20:59:01 2012
New Revision: 1422354
URL: http://svn.apache.org/viewvc?rev=1422354&view=rev
Log:
Combined if statements (PMD).
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.java?rev=1422354&r1=1422353&r2=1422354&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.java Sat Dec 15 20:59:01 2012
@@ -353,11 +353,9 @@ public class DescriptiveStatistics imple
* 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;