diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
index ce7cbbfa6..3390d4d2a 100644
--- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
+++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java
@@ -547,11 +547,6 @@ static double pelzGood(double x, int n) {
// This is the form for K0.
// Compute all together over odd integers and divide factors
// of (k + 1/2)^b by 2^b.
- double k0 = 0;
- double k1 = 0;
- double k2 = 0;
- double k3 = 0;
-
final double rootN = Math.sqrt(n);
final double z = x * rootN;
final double z3 = z * z2;
@@ -579,6 +574,10 @@ static double pelzGood(double x, int n) {
// 0 = k^2 - k + log(eps) * 2z^2 / pi^2
// Solve using quadratic equation and eps = ulp(1.0): 4a ~ -288
final int max = (int) Math.ceil((1 + Math.sqrt(1 - FOUR_A * z2 / PI2)) / 2);
+ double k0 = 0;
+ double k1 = 0;
+ double k2 = 0;
+ double k3 = 0;
// Sum smallest terms first
for (int k = max; k > 0; k--) {
final int j = 2 * k - 1;
diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/SquareMatrixSupport.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/SquareMatrixSupport.java
index 3ca5b8204..99332dcf3 100644
--- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/SquareMatrixSupport.java
+++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/SquareMatrixSupport.java
@@ -153,8 +153,6 @@ public RealSquareMatrix power(int n) {
// Working arrays
final double[] col = new double[dim];
- double[] b = new double[data.length];
- double[] tmp;
// Initialise result as A^1.
final double[] a = data;
@@ -168,6 +166,8 @@ public RealSquareMatrix power(int n) {
int bits = n << shift;
// Process remaining bits below highest set bit.
+ double[] b = new double[data.length];
+ double[] tmp;
for (int i = 32 - shift; i != 0; i--, bits <<= 1) {
// Square the result
er = multiply(r, er, r, er, col, b);
diff --git a/src/conf/pmd/pmd-ruleset.xml b/src/conf/pmd/pmd-ruleset.xml
index 76cea6979..6a6e45222 100644
--- a/src/conf/pmd/pmd-ruleset.xml
+++ b/src/conf/pmd/pmd-ruleset.xml
@@ -104,6 +104,14 @@
value="./ancestor-or-self::MethodDeclaration[@Name='twoSampleTwoSidedPStabilizedInner']"/>
+
+
+
+
+
+