You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2023/02/16 14:46:24 UTC

[commons-statistics] 01/05: Sonar fix: Avoid use of restricted identifier

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit f8ad764ba23e0c6b602e9be920d1702559e3afbe
Author: aherbert <ah...@apache.org>
AuthorDate: Thu Feb 16 13:42:58 2023 +0000

    Sonar fix: Avoid use of restricted identifier
---
 .../org/apache/commons/statistics/inference/MannWhitneyUTest.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/MannWhitneyUTest.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/MannWhitneyUTest.java
index dae525f..5c94ba2 100644
--- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/MannWhitneyUTest.java
+++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/MannWhitneyUTest.java
@@ -348,7 +348,7 @@ public final class MannWhitneyUTest {
 
         // https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test#Normal_approximation_and_tie_correction
         final double e = n1n2 * 0.5;
-        final double var = (n1n2 / 12.0) * ((n + 1.0) - c / n / (n - 1));
+        final double variance = (n1n2 / 12.0) * ((n + 1.0) - c / n / (n - 1));
 
         double z = u - e;
         if (continuityCorrection) {
@@ -363,7 +363,7 @@ public final class MannWhitneyUTest {
                 z -= Math.signum(z) * 0.5;
             }
         }
-        z /= Math.sqrt(var);
+        z /= Math.sqrt(variance);
 
         final NormalDistribution standardNormal = NormalDistribution.of(0, 1);
         if (alternative == AlternativeHypothesis.GREATER_THAN) {