=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java 2013-10-16 16:00:05 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java 2013-10-17 04:03:14 +0000 @@ -440,7 +440,7 @@ * @param sampleValues sample values actually collected * @param annualSampleCount number of annual samples tried for * @param sequentialSampleCount number of sequential samples tried for - * @return + * @return average right-side sample value */ Double rightSideAverage( ValidationRule rule, List sampleValues, int annualSampleCount, int sequentialSampleCount ) @@ -458,7 +458,7 @@ int lowOutliers = rule.getLowOutliers() == null ? 0 : rule.getLowOutliers(); // If fewer than the expected number of samples, then scale back - if ( highOutliers + lowOutliers > sampleValues.size() ) + if ( sampleValues.size() < expectedSampleCount ) { highOutliers = (highOutliers * sampleValues.size()) / expectedSampleCount; lowOutliers = (lowOutliers * sampleValues.size()) / expectedSampleCount;