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-rng.git


The following commit(s) were added to refs/heads/master by this push:
     new d8c648d7 Sonar fix: Rename variable to not match restricted identifier
d8c648d7 is described below

commit d8c648d7be1e77c5b1c41a426ee5c633cdcd575c
Author: Alex Herbert <aherb...@apache.org>
AuthorDate: Mon Jul 1 17:26:08 2024 +0100

    Sonar fix: Rename variable to not match restricted identifier
---
 .../commons/rng/sampling/distribution/DirichletSamplerTest.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
 
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
index b79dba1a..1dc6c6c0 100644
--- 
a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
+++ 
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DirichletSamplerTest.java
@@ -228,8 +228,8 @@ class DirichletSamplerTest {
         final double[][] covars = getCovariance(samples);
         final double denom = alpha0 * alpha0 * (alpha0 + 1);
         for (int i = 0; i < k; i++) {
-            final double var = alpha[i] * (alpha0 - alpha[i]) / denom;
-            Assertions.assertEquals(var, covars[i][i], var * 
relativeTolerance, "Variance");
+            final double variance = alpha[i] * (alpha0 - alpha[i]) / denom;
+            Assertions.assertEquals(variance, covars[i][i], variance * 
relativeTolerance, "Variance");
             for (int j = i + 1; j < k; j++) {
                 final double covar = -alpha[i] * alpha[j] / denom;
                 Assertions.assertEquals(covar, covars[i][j], Math.abs(covar) * 
relativeTolerance, "Covariance");

Reply via email to