commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [commons-rng] branch master updated: Nits.
Date Sun, 03 Mar 2019 12:45:48 GMT
This is an automated email from the ASF dual-hosted git repository.

erans 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 14871a9  Nits.
14871a9 is described below

commit 14871a99fde1c6d5ada880bdc7811a4970ba3955
Author: Gilles Sadowski <gilles@harfang.homelinux.org>
AuthorDate: Sun Mar 3 13:35:22 2019 +0100

    Nits.
    
    Issues reported by "SonarQube".
---
 .../rng/sampling/distribution/LargeMeanPoissonSampler.java | 14 +++++++-------
 .../commons/rng/sampling/distribution/PoissonSampler.java  |  8 ++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
index 47ecab7..1848bb4 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
@@ -187,13 +187,13 @@ public class LargeMeanPoissonSampler
             0 : // No lambda fraction
             smallMeanPoissonSampler.sample();
 
-        double x = 0;
-        double y = 0;
-        double v = 0;
-        int a = 0;
-        double t = 0;
-        double qr = 0;
-        double qa = 0;
+        double x;
+        double y;
+        double v;
+        int a;
+        double t;
+        double qr;
+        double qa;
         while (true) {
             final double u = rng.nextDouble();
             if (u <= p1) {
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
index 2889108..0d52ba1 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
@@ -49,7 +49,7 @@ public class PoissonSampler
      */
     static final double PIVOT = 40;
     /** The internal Poisson sampler. */
-    private final DiscreteSampler poissonSampler;
+    private final DiscreteSampler poissonSamplerDelegate;
 
     /**
      * @param rng Generator of uniformly distributed random numbers.
@@ -63,7 +63,7 @@ public class PoissonSampler
 
         // Delegate all work to specialised samplers.
         // These should check the input arguments.
-        poissonSampler = mean < PIVOT ?
+        poissonSamplerDelegate = mean < PIVOT ?
             new SmallMeanPoissonSampler(rng, mean) :
             new LargeMeanPoissonSampler(rng, mean);
     }
@@ -71,12 +71,12 @@ public class PoissonSampler
     /** {@inheritDoc} */
     @Override
     public int sample() {
-        return poissonSampler.sample();
+        return poissonSamplerDelegate.sample();
     }
 
     /** {@inheritDoc} */
     @Override
     public String toString() {
-        return poissonSampler.toString();
+        return poissonSamplerDelegate.toString();
     }
 }


Mime
View raw message