You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2015/12/25 17:23:36 UTC

[01/10] [math] Removed unused variables.

Repository: commons-math
Updated Branches:
  refs/heads/MATH_3_X 1ac6991a7 -> d3fdc7227


Removed unused variables.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/09c2b5ff
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/09c2b5ff
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/09c2b5ff

Branch: refs/heads/MATH_3_X
Commit: 09c2b5fff3d7056d5ec2364d4b86ffeaef6fce2c
Parents: ee504b6
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 15:08:10 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 15:08:10 2015 +0100

----------------------------------------------------------------------
 .../commons/math3/distribution/NormalDistributionTest.java      | 1 -
 .../java/org/apache/commons/math3/util/IntegerSequenceTest.java | 5 +----
 2 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/09c2b5ff/src/test/java/org/apache/commons/math3/distribution/NormalDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/distribution/NormalDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/NormalDistributionTest.java
index 1cd9d0f..50775f1 100644
--- a/src/test/java/org/apache/commons/math3/distribution/NormalDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/NormalDistributionTest.java
@@ -117,7 +117,6 @@ public class NormalDistributionTest extends RealDistributionAbstractTest {
         double x = -10;
         double expected = 7.61985e-24;
         double v = dist.cumulativeProbability(x);
-        double tol = 1e-5;
         Assert.assertEquals(1, v / expected, 1e-5);
     }
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/09c2b5ff/src/test/java/org/apache/commons/math3/util/IntegerSequenceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/util/IntegerSequenceTest.java b/src/test/java/org/apache/commons/math3/util/IntegerSequenceTest.java
index 9707cee..8743c16 100644
--- a/src/test/java/org/apache/commons/math3/util/IntegerSequenceTest.java
+++ b/src/test/java/org/apache/commons/math3/util/IntegerSequenceTest.java
@@ -220,10 +220,7 @@ public class IntegerSequenceTest {
     @Test(expected=ZeroException.class)
     public void testIncrementZeroStep() {
         final int step = 0;
-
-        final IntegerSequence.Incrementor inc
-            = IntegerSequence.Incrementor.create()
-            .withIncrement(step);
+        IntegerSequence.Incrementor.create().withIncrement(step);
     }
 
     @Test


[03/10] [math] Another round of deprecation warnings removal in tests.

Posted by lu...@apache.org.
Another round of deprecation warnings removal in tests.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/370fd53b
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/370fd53b
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/370fd53b

Branch: refs/heads/MATH_3_X
Commit: 370fd53bee71047aa394b0f86ed883848d110fac
Parents: b078df4
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 15:27:00 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 15:27:00 2015 +0100

----------------------------------------------------------------------
 .../math3/distribution/ExponentialDistributionTest.java       | 1 +
 .../commons/math3/distribution/GammaDistributionTest.java     | 1 +
 .../math3/distribution/RealDistributionAbstractTest.java      | 6 ++++++
 .../fitting/leastsquares/RandomCirclePointGenerator.java      | 3 +--
 .../leastsquares/RandomStraightLinePointGenerator.java        | 3 +--
 .../commons/math3/random/EmpiricalDistributionTest.java       | 7 +++++--
 .../commons/math3/transform/FastFourierTransformerTest.java   | 2 ++
 .../apache/commons/math3/util/ResizableDoubleArrayTest.java   | 3 +++
 8 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/distribution/ExponentialDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/distribution/ExponentialDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/ExponentialDistributionTest.java
index 35d6e60..08627b6 100644
--- a/src/test/java/org/apache/commons/math3/distribution/ExponentialDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/ExponentialDistributionTest.java
@@ -85,6 +85,7 @@ public class ExponentialDistributionTest extends RealDistributionAbstractTest {
 
     @Test
     public void testCumulativeProbability2() {
+        @SuppressWarnings("deprecation")
         double actual = getDistribution().cumulativeProbability(0.25, 0.75);
         Assert.assertEquals(0.0905214, actual, 10e-4);
     }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/distribution/GammaDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/distribution/GammaDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/GammaDistributionTest.java
index c07bbe1..01115b7 100644
--- a/src/test/java/org/apache/commons/math3/distribution/GammaDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/GammaDistributionTest.java
@@ -74,6 +74,7 @@ public class GammaDistributionTest extends RealDistributionAbstractTest {
     }
 
     //---------------------------- Additional test cases -------------------------
+    @SuppressWarnings("deprecation")
     @Test
     public void testParameterAccessors() {
         GammaDistribution distribution = (GammaDistribution) getDistribution();

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/distribution/RealDistributionAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/distribution/RealDistributionAbstractTest.java b/src/test/java/org/apache/commons/math3/distribution/RealDistributionAbstractTest.java
index 4ca1fb8..d795ee7 100644
--- a/src/test/java/org/apache/commons/math3/distribution/RealDistributionAbstractTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/RealDistributionAbstractTest.java
@@ -171,6 +171,7 @@ public abstract class RealDistributionAbstractTest {
      * Verifies that cumulative probability density calculations match expected values
      * using current test instance data
      */
+    @SuppressWarnings("deprecation")
     protected void verifyCumulativeProbabilities() {
         // verify cumulativeProbability(double)
         for (int i = 0; i < cumulativeTestPoints.length; i++) {
@@ -278,6 +279,7 @@ public abstract class RealDistributionAbstractTest {
     /**
      * Verifies that probability computations are consistent
      */
+    @SuppressWarnings("deprecation")
     @Test
     public void testConsistency() {
         for (int i=1; i < cumulativeTestPoints.length; i++) {
@@ -303,6 +305,7 @@ public abstract class RealDistributionAbstractTest {
     /**
      * Verifies that illegal arguments are correctly handled
      */
+    @SuppressWarnings("deprecation")
     @Test
     public void testIllegalArguments() {
         try {
@@ -351,6 +354,7 @@ public abstract class RealDistributionAbstractTest {
      * interval. Test points outside of the domain of the density function
      * are discarded.
      */
+    @SuppressWarnings("deprecation")
     @Test
     public void testDensityIntegrals() {
         final double tol = 1.0e-9;
@@ -386,6 +390,7 @@ public abstract class RealDistributionAbstractTest {
      * Verify that isSupportLowerBoundInclusvie returns true iff the lower bound
      * is finite and density is non-NaN, non-infinite there.
      */
+    @SuppressWarnings("deprecation")
     @Test
     public void testIsSupportLowerBoundInclusive() {
         final double lowerBound = distribution.getSupportLowerBound();
@@ -402,6 +407,7 @@ public abstract class RealDistributionAbstractTest {
      * Verify that isSupportUpperBoundInclusvie returns true iff the upper bound
      * is finite and density is non-NaN, non-infinite there.
      */
+    @SuppressWarnings("deprecation")
     @Test
     public void testIsSupportUpperBoundInclusive() {
         final double upperBound = distribution.getSupportUpperBound();

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomCirclePointGenerator.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomCirclePointGenerator.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomCirclePointGenerator.java
index 3f9a20d..240ae94 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomCirclePointGenerator.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomCirclePointGenerator.java
@@ -58,8 +58,7 @@ public class RandomCirclePointGenerator {
                                     NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
         cY = new NormalDistribution(rng, y, ySigma,
                                     NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
-        tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI,
-                                         UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+        tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomStraightLinePointGenerator.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomStraightLinePointGenerator.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomStraightLinePointGenerator.java
index 1c60cd2..39c2009 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomStraightLinePointGenerator.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/RandomStraightLinePointGenerator.java
@@ -65,8 +65,7 @@ public class RandomStraightLinePointGenerator {
         intercept = b;
         error = new NormalDistribution(rng, 0, sigma,
                                        NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
-        x = new UniformRealDistribution(rng, lo, hi,
-                                        UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+        x = new UniformRealDistribution(rng, lo, hi);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java b/src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java
index c0dd2a4..9e3bc81 100644
--- a/src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java
@@ -358,7 +358,9 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
             // First bin has mass 11 / 10000, the rest have mass 10 / 10000.
             final double bMinus = bin == 0 ? 0 : (bin - 1) * binMass + firstBinMass;
             final RealDistribution kernel = findKernel(lower, upper);
+            @SuppressWarnings("deprecation")
             final double withinBinKernelMass = kernel.cumulativeProbability(lower, upper);
+            @SuppressWarnings("deprecation")
             final double kernelCum = kernel.cumulativeProbability(lower, testPoints[i]);
             cumValues[i] = bMinus + (bin == 0 ? firstBinMass : binMass) * kernelCum/withinBinKernelMass;
         }
@@ -377,6 +379,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
                 binBounds[bin - 1];
             final double upper = binBounds[bin];
             final RealDistribution kernel = findKernel(lower, upper);
+            @SuppressWarnings("deprecation")
             final double withinBinKernelMass = kernel.cumulativeProbability(lower, upper);
             final double density = kernel.density(testPoints[i]);
             densityValues[i] = density * (bin == 0 ? firstBinMass : binMass) / withinBinKernelMass;
@@ -390,6 +393,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
      * will face convergence problems.  Only test within-bin integrals and spans
      * across no more than 3 bin boundaries.
      */
+    @SuppressWarnings("deprecation")
     @Override
     @Test
     public void testDensityIntegrals() {
@@ -566,8 +570,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
         }
         @Override
         protected RealDistribution getKernel(SummaryStatistics bStats) {
-            return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax(),
-                    UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+            return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/transform/FastFourierTransformerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/transform/FastFourierTransformerTest.java b/src/test/java/org/apache/commons/math3/transform/FastFourierTransformerTest.java
index af70eed..8791fc7 100644
--- a/src/test/java/org/apache/commons/math3/transform/FastFourierTransformerTest.java
+++ b/src/test/java/org/apache/commons/math3/transform/FastFourierTransformerTest.java
@@ -484,6 +484,7 @@ public final class FastFourierTransformerTest {
      * Additional tests for 2D data.
      */
 
+    @SuppressWarnings("deprecation")
     @Test
     public void test2DData() {
         FastFourierTransformer transformer;
@@ -525,6 +526,7 @@ public final class FastFourierTransformerTest {
         }
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void test2DDataUnitary() {
         FastFourierTransformer transformer;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/370fd53b/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java b/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java
index 1a7b45a..0ed58e6 100644
--- a/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java
+++ b/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java
@@ -43,6 +43,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
         ra = new ResizableDoubleArray();
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void testConstructors() {
         float defaultExpansionFactor = 2.0f;
@@ -339,6 +340,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
                 iterations + 1 , eDA2.getNumElements() );
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void testWithInitialCapacityAndExpansionFactor() {
 
@@ -447,6 +449,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
 
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void testMutators() {
         ((ResizableDoubleArray)da).setContractionCriteria(10f);


[10/10] [math] Merge branch 'MATH_3_X' of https://luc@git-wip-us.apache.org/repos/asf/commons-math.git into MATH_3_X

Posted by lu...@apache.org.
Merge branch 'MATH_3_X' of https://luc@git-wip-us.apache.org/repos/asf/commons-math.git into MATH_3_X

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/d3fdc722
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/d3fdc722
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/d3fdc722

Branch: refs/heads/MATH_3_X
Commit: d3fdc7227b32151955536f43e1d745d33913ad28
Parents: 4757bc8 1ac6991
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 17:17:23 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 17:17:23 2015 +0100

----------------------------------------------------------------------
 .../org/apache/commons/math3/linear/FieldMatrix.java | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



Re: [09/10] [math] Prevent findbugs false positive.

Posted by Luc Maisonobe <lu...@spaceroots.org>.
Le 25/12/2015 19:50, Phil Steitz a écrit :
> On 12/25/15 9:29 AM, Luc Maisonobe wrote:
>> Hi all,
>>
>> Le 25/12/2015 17:23, luc@apache.org a écrit :
>>> Prevent findbugs false positive.
>> This commit was intended to fix a false positive in findbugs.
>> The field iterations has been deprecated and is not used
>> anymore in the library. However, as it is protected and not
>> private, it cannot be removed and it should be initialized
>> properly. In this case a dedicated wrapper class allow it
>> to delegate to its replacement field.
>>
>> So I tried to add the following in our findbugs-exclude-filter.xml,
>> so it is no displayed anymore. This failed. The warning still
>> appears in the findbugs report.
>>
>> Do anyone of you understand why the filter doesn't work? I have
>> reread 4 times the <Match></Match> element and did not see
>> what I wrote wrong.
>>
>> Any help would be greatly appreciated.
> 
> I just pushed a change that works for me, which was to emove the
> method spec in the match.  This makes sense, since the exclusion
> applies at the class level.

Thanks a lot, Phil !

best regards,
Luc

> 
> Phil
>>
>> best regards,
>> Luc
>>
>>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4757bc82
>>> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4757bc82
>>> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4757bc82
>>>
>>> Branch: refs/heads/MATH_3_X
>>> Commit: 4757bc82f9bb3457db6c6ad1f825a9f9214a7d48
>>> Parents: 6259f3f
>>> Author: Luc Maisonobe <lu...@apache.org>
>>> Authored: Fri Dec 25 16:54:16 2015 +0100
>>> Committer: Luc Maisonobe <lu...@apache.org>
>>> Committed: Fri Dec 25 16:54:16 2015 +0100
>>>
>>> ----------------------------------------------------------------------
>>>  findbugs-exclude-filter.xml | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>> ----------------------------------------------------------------------
>>>
>>>
>>> http://git-wip-us.apache.org/repos/asf/commons-math/blob/4757bc82/findbugs-exclude-filter.xml
>>> ----------------------------------------------------------------------
>>> diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml
>>> index 5a960ca..d32fbbe 100644
>>> --- a/findbugs-exclude-filter.xml
>>> +++ b/findbugs-exclude-filter.xml
>>> @@ -23,6 +23,14 @@
>>>  -->
>>>  <FindBugsFilter>
>>>  
>>> +  <!-- the following field is unused but cannot be suppressed as it is protected -->
>>> +  <!-- and some user class may require it -->
>>> +  <Match>
>>> +    <Class name="org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator" />
>>> +    <Method name="&lt;init>" params="double,double,int,int" returns="void" />
>>> +    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
>>> +  </Match>
>>> +
>>>    <!--  the following equality tests are part of the reference algorithms -->
>>>    <!--  which already know about limited precision of the double numbers -->
>>>    <Match>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [09/10] [math] Prevent findbugs false positive.

Posted by Phil Steitz <ph...@gmail.com>.
On 12/25/15 9:29 AM, Luc Maisonobe wrote:
> Hi all,
>
> Le 25/12/2015 17:23, luc@apache.org a écrit :
>> Prevent findbugs false positive.
> This commit was intended to fix a false positive in findbugs.
> The field iterations has been deprecated and is not used
> anymore in the library. However, as it is protected and not
> private, it cannot be removed and it should be initialized
> properly. In this case a dedicated wrapper class allow it
> to delegate to its replacement field.
>
> So I tried to add the following in our findbugs-exclude-filter.xml,
> so it is no displayed anymore. This failed. The warning still
> appears in the findbugs report.
>
> Do anyone of you understand why the filter doesn't work? I have
> reread 4 times the <Match></Match> element and did not see
> what I wrote wrong.
>
> Any help would be greatly appreciated.

I just pushed a change that works for me, which was to emove the
method spec in the match.  This makes sense, since the exclusion
applies at the class level.

Phil
>
> best regards,
> Luc
>
>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4757bc82
>> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4757bc82
>> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4757bc82
>>
>> Branch: refs/heads/MATH_3_X
>> Commit: 4757bc82f9bb3457db6c6ad1f825a9f9214a7d48
>> Parents: 6259f3f
>> Author: Luc Maisonobe <lu...@apache.org>
>> Authored: Fri Dec 25 16:54:16 2015 +0100
>> Committer: Luc Maisonobe <lu...@apache.org>
>> Committed: Fri Dec 25 16:54:16 2015 +0100
>>
>> ----------------------------------------------------------------------
>>  findbugs-exclude-filter.xml | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/commons-math/blob/4757bc82/findbugs-exclude-filter.xml
>> ----------------------------------------------------------------------
>> diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml
>> index 5a960ca..d32fbbe 100644
>> --- a/findbugs-exclude-filter.xml
>> +++ b/findbugs-exclude-filter.xml
>> @@ -23,6 +23,14 @@
>>  -->
>>  <FindBugsFilter>
>>  
>> +  <!-- the following field is unused but cannot be suppressed as it is protected -->
>> +  <!-- and some user class may require it -->
>> +  <Match>
>> +    <Class name="org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator" />
>> +    <Method name="&lt;init>" params="double,double,int,int" returns="void" />
>> +    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
>> +  </Match>
>> +
>>    <!--  the following equality tests are part of the reference algorithms -->
>>    <!--  which already know about limited precision of the double numbers -->
>>    <Match>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [09/10] [math] Prevent findbugs false positive.

Posted by Luc Maisonobe <lu...@spaceroots.org>.
Hi all,

Le 25/12/2015 17:23, luc@apache.org a écrit :
> Prevent findbugs false positive.

This commit was intended to fix a false positive in findbugs.
The field iterations has been deprecated and is not used
anymore in the library. However, as it is protected and not
private, it cannot be removed and it should be initialized
properly. In this case a dedicated wrapper class allow it
to delegate to its replacement field.

So I tried to add the following in our findbugs-exclude-filter.xml,
so it is no displayed anymore. This failed. The warning still
appears in the findbugs report.

Do anyone of you understand why the filter doesn't work? I have
reread 4 times the <Match></Match> element and did not see
what I wrote wrong.

Any help would be greatly appreciated.

best regards,
Luc

> 
> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
> Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4757bc82
> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4757bc82
> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4757bc82
> 
> Branch: refs/heads/MATH_3_X
> Commit: 4757bc82f9bb3457db6c6ad1f825a9f9214a7d48
> Parents: 6259f3f
> Author: Luc Maisonobe <lu...@apache.org>
> Authored: Fri Dec 25 16:54:16 2015 +0100
> Committer: Luc Maisonobe <lu...@apache.org>
> Committed: Fri Dec 25 16:54:16 2015 +0100
> 
> ----------------------------------------------------------------------
>  findbugs-exclude-filter.xml | 8 ++++++++
>  1 file changed, 8 insertions(+)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/commons-math/blob/4757bc82/findbugs-exclude-filter.xml
> ----------------------------------------------------------------------
> diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml
> index 5a960ca..d32fbbe 100644
> --- a/findbugs-exclude-filter.xml
> +++ b/findbugs-exclude-filter.xml
> @@ -23,6 +23,14 @@
>  -->
>  <FindBugsFilter>
>  
> +  <!-- the following field is unused but cannot be suppressed as it is protected -->
> +  <!-- and some user class may require it -->
> +  <Match>
> +    <Class name="org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator" />
> +    <Method name="&lt;init>" params="double,double,int,int" returns="void" />
> +    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
> +  </Match>
> +
>    <!--  the following equality tests are part of the reference algorithms -->
>    <!--  which already know about limited precision of the double numbers -->
>    <Match>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[09/10] [math] Prevent findbugs false positive.

Posted by lu...@apache.org.
Prevent findbugs false positive.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4757bc82
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4757bc82
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4757bc82

Branch: refs/heads/MATH_3_X
Commit: 4757bc82f9bb3457db6c6ad1f825a9f9214a7d48
Parents: 6259f3f
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 16:54:16 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 16:54:16 2015 +0100

----------------------------------------------------------------------
 findbugs-exclude-filter.xml | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/4757bc82/findbugs-exclude-filter.xml
----------------------------------------------------------------------
diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml
index 5a960ca..d32fbbe 100644
--- a/findbugs-exclude-filter.xml
+++ b/findbugs-exclude-filter.xml
@@ -23,6 +23,14 @@
 -->
 <FindBugsFilter>
 
+  <!-- the following field is unused but cannot be suppressed as it is protected -->
+  <!-- and some user class may require it -->
+  <Match>
+    <Class name="org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator" />
+    <Method name="&lt;init>" params="double,double,int,int" returns="void" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
+
   <!--  the following equality tests are part of the reference algorithms -->
   <!--  which already know about limited precision of the double numbers -->
   <Match>


[05/10] [math] Supressed varargs warnings in tests.

Posted by lu...@apache.org.
Supressed varargs warnings in tests.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/903c315a
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/903c315a
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/903c315a

Branch: refs/heads/MATH_3_X
Commit: 903c315a54fc14204b9a80fc4111a0c531079f9e
Parents: 4ed1d03
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 15:29:04 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 15:29:04 2015 +0100

----------------------------------------------------------------------
 src/test/java/org/apache/commons/math3/PerfTestUtils.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/903c315a/src/test/java/org/apache/commons/math3/PerfTestUtils.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/PerfTestUtils.java b/src/test/java/org/apache/commons/math3/PerfTestUtils.java
index 4558305..d8c1caf 100644
--- a/src/test/java/org/apache/commons/math3/PerfTestUtils.java
+++ b/src/test/java/org/apache/commons/math3/PerfTestUtils.java
@@ -50,6 +50,7 @@ public class PerfTestUtils {
      * taken by a single call to the {@code call} method (i.e. the time
      * taken by each timed block divided by {@code repeatChunk}).
      */
+    @SuppressWarnings("unchecked")
     public static StatisticalSummary[] time(int repeatChunk,
                                             int repeatStat,
                                             boolean runGC,
@@ -94,6 +95,7 @@ public class PerfTestUtils {
      *  </li>
      * </ul>
      */
+    @SuppressWarnings("unchecked")
     public static double[][][] timesAndResults(int repeatChunk,
                                                int repeatStat,
                                                boolean runGC,


[02/10] [math] Removed unneeded annotation.

Posted by lu...@apache.org.
Removed unneeded annotation.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/b078df4e
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/b078df4e
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/b078df4e

Branch: refs/heads/MATH_3_X
Commit: b078df4ecdee192eb7c52ea1226edc45a50cb401
Parents: 09c2b5f
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 15:08:43 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 15:08:43 2015 +0100

----------------------------------------------------------------------
 .../math3/analysis/interpolation/TricubicInterpolatorTest.java      | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/b078df4e/src/test/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatorTest.java b/src/test/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatorTest.java
index d66e2d6..9f5dd87 100644
--- a/src/test/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math3/analysis/interpolation/TricubicInterpolatorTest.java
@@ -90,7 +90,6 @@ public final class TricubicInterpolatorTest {
         double[] zval = new double[] {-12, -8, -5.5, -3, 0, 2.5};
         double[][][] fval = new double[xval.length][yval.length][zval.length];
 
-        @SuppressWarnings("unused")
         TricubicInterpolatingFunction tcf = new TricubicInterpolator().interpolate(xval, yval, zval, fval);
 
         // Valid.


[07/10] [math] Removed spurious semicolon.

Posted by lu...@apache.org.
Removed spurious semicolon.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/25474e24
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/25474e24
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/25474e24

Branch: refs/heads/MATH_3_X
Commit: 25474e247a472db1cc1eafa885e74bc426bee8fc
Parents: 44d949a
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 16:47:47 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 16:47:47 2015 +0100

----------------------------------------------------------------------
 .../analysis/integration/IterativeLegendreGaussIntegrator.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/25474e24/src/main/java/org/apache/commons/math3/analysis/integration/IterativeLegendreGaussIntegrator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/IterativeLegendreGaussIntegrator.java b/src/main/java/org/apache/commons/math3/analysis/integration/IterativeLegendreGaussIntegrator.java
index d08cf08..20700dd 100644
--- a/src/main/java/org/apache/commons/math3/analysis/integration/IterativeLegendreGaussIntegrator.java
+++ b/src/main/java/org/apache/commons/math3/analysis/integration/IterativeLegendreGaussIntegrator.java
@@ -142,7 +142,7 @@ public class IterativeLegendreGaussIntegrator
             final double ratio = FastMath.min(4, FastMath.pow(delta / limit, 0.5 / numberOfPoints));
             n = FastMath.max((int) (ratio * n), n + 1);
             oldt = t;
-            incrementCount();;
+            incrementCount();
         }
     }
 


[04/10] [math] Unused import.

Posted by lu...@apache.org.
Unused import.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4ed1d037
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4ed1d037
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4ed1d037

Branch: refs/heads/MATH_3_X
Commit: 4ed1d0375b46a4b82ac8f340eb0455c965c2c48a
Parents: 370fd53
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 15:27:41 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 15:27:41 2015 +0100

----------------------------------------------------------------------
 .../commons/math3/ml/neuralnet/twod/util/LocationFinderTest.java    | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/4ed1d037/src/test/java/org/apache/commons/math3/ml/neuralnet/twod/util/LocationFinderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/ml/neuralnet/twod/util/LocationFinderTest.java b/src/test/java/org/apache/commons/math3/ml/neuralnet/twod/util/LocationFinderTest.java
index dcadc47..2ef53e4 100644
--- a/src/test/java/org/apache/commons/math3/ml/neuralnet/twod/util/LocationFinderTest.java
+++ b/src/test/java/org/apache/commons/math3/ml/neuralnet/twod/util/LocationFinderTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.commons.math3.ml.neuralnet.twod.util;
 
-import org.apache.commons.math3.ml.neuralnet.Neuron;
 import org.apache.commons.math3.ml.neuralnet.Network;
 import org.apache.commons.math3.ml.neuralnet.FeatureInitializer;
 import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory;


[06/10] [math] Avoid compiler warnings due to imports of deprecated classes.

Posted by lu...@apache.org.
Avoid compiler warnings due to imports of deprecated classes.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/44d949a1
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/44d949a1
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/44d949a1

Branch: refs/heads/MATH_3_X
Commit: 44d949a1c3a402feed26340d636d768fc52b6e69
Parents: 903c315
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 16:33:28 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 16:33:28 2015 +0100

----------------------------------------------------------------------
 .../commons/math3/distribution/AbstractIntegerDistribution.java  | 4 ++--
 .../commons/math3/distribution/AbstractRealDistribution.java     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/44d949a1/src/main/java/org/apache/commons/math3/distribution/AbstractIntegerDistribution.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/distribution/AbstractIntegerDistribution.java b/src/main/java/org/apache/commons/math3/distribution/AbstractIntegerDistribution.java
index 82a96c5..e51ba50 100644
--- a/src/main/java/org/apache/commons/math3/distribution/AbstractIntegerDistribution.java
+++ b/src/main/java/org/apache/commons/math3/distribution/AbstractIntegerDistribution.java
@@ -24,7 +24,6 @@ import org.apache.commons.math3.exception.NumberIsTooLargeException;
 import org.apache.commons.math3.exception.OutOfRangeException;
 import org.apache.commons.math3.exception.util.LocalizedFormats;
 import org.apache.commons.math3.random.RandomGenerator;
-import org.apache.commons.math3.random.RandomDataImpl;
 import org.apache.commons.math3.util.FastMath;
 
 /**
@@ -44,7 +43,8 @@ public abstract class AbstractIntegerDistribution implements IntegerDistribution
      * {@link #random} instance variable instead.
      */
     @Deprecated
-    protected final RandomDataImpl randomData = new RandomDataImpl();
+    protected final org.apache.commons.math3.random.RandomDataImpl randomData =
+        new org.apache.commons.math3.random.RandomDataImpl();
 
     /**
      * RNG instance used to generate samples from the distribution.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/44d949a1/src/main/java/org/apache/commons/math3/distribution/AbstractRealDistribution.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/distribution/AbstractRealDistribution.java b/src/main/java/org/apache/commons/math3/distribution/AbstractRealDistribution.java
index fb894b6..dbf0227 100644
--- a/src/main/java/org/apache/commons/math3/distribution/AbstractRealDistribution.java
+++ b/src/main/java/org/apache/commons/math3/distribution/AbstractRealDistribution.java
@@ -25,7 +25,6 @@ import org.apache.commons.math3.exception.NumberIsTooLargeException;
 import org.apache.commons.math3.exception.OutOfRangeException;
 import org.apache.commons.math3.exception.util.LocalizedFormats;
 import org.apache.commons.math3.random.RandomGenerator;
-import org.apache.commons.math3.random.RandomDataImpl;
 import org.apache.commons.math3.util.FastMath;
 
 /**
@@ -47,7 +46,8 @@ implements RealDistribution, Serializable {
       * {@link #random} instance variable instead.
       */
     @Deprecated
-    protected RandomDataImpl randomData = new RandomDataImpl();
+    protected org.apache.commons.math3.random.RandomDataImpl randomData =
+        new org.apache.commons.math3.random.RandomDataImpl();
 
     /**
      * RNG instance used to generate samples from the distribution.


[08/10] [math] Missing javadoc.

Posted by lu...@apache.org.
Missing javadoc.

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/6259f3f3
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/6259f3f3
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/6259f3f3

Branch: refs/heads/MATH_3_X
Commit: 6259f3f3935d35215657baef60df668b5c563aa4
Parents: 25474e2
Author: Luc Maisonobe <lu...@apache.org>
Authored: Fri Dec 25 16:48:46 2015 +0100
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Fri Dec 25 16:48:46 2015 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/math3/util/IterationManager.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/6259f3f3/src/main/java/org/apache/commons/math3/util/IterationManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/util/IterationManager.java b/src/main/java/org/apache/commons/math3/util/IterationManager.java
index ffda23e..4839c96 100644
--- a/src/main/java/org/apache/commons/math3/util/IterationManager.java
+++ b/src/main/java/org/apache/commons/math3/util/IterationManager.java
@@ -61,6 +61,7 @@ public class IterationManager {
     public IterationManager(final int maxIterations,
                             final Incrementor.MaxCountExceededCallback callBack) {
         this(maxIterations, new IntegerSequence.Incrementor.MaxCountExceededCallback() {
+            /** {@inheritDoc} */
             @Override
             public void trigger(final int maximalCount) throws MaxCountExceededException {
                 callBack.trigger(maximalCount);