commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1421290 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim: BaseMultiStartMultivariateOptimizer.java univariate/MultiStartUnivariateOptimizer.java
Date Thu, 13 Dec 2012 13:39:05 GMT
Author: erans
Date: Thu Dec 13 13:39:04 2012
New Revision: 1421290

URL: http://svn.apache.org/viewvc?rev=1421290&view=rev
Log:
Removed inconsistent null checks (reported by FindBugs).

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/BaseMultiStartMultivariateOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/univariate/MultiStartUnivariateOptimizer.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/BaseMultiStartMultivariateOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/BaseMultiStartMultivariateOptimizer.java?rev=1421290&r1=1421289&r2=1421290&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/BaseMultiStartMultivariateOptimizer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/BaseMultiStartMultivariateOptimizer.java
Thu Dec 13 13:39:04 2012
@@ -18,7 +18,6 @@ package org.apache.commons.math3.optim;
 
 import org.apache.commons.math3.exception.MathIllegalStateException;
 import org.apache.commons.math3.exception.NotStrictlyPositiveException;
-import org.apache.commons.math3.exception.NullArgumentException;
 import org.apache.commons.math3.random.RandomVectorGenerator;
 
 /**
@@ -66,8 +65,6 @@ public abstract class BaseMultiStartMult
      * the {@link #optimize(OptimizationData[]) optimize} will return the
      * same solution as the given {@code optimizer} would return.
      * @param generator Random vector generator to use for restarts.
-     * @throws NullArgumentException if {@code optimizer} or {@code generator}
-     * is {@code null}.
      * @throws NotStrictlyPositiveException if {@code starts < 1}.
      */
     public BaseMultiStartMultivariateOptimizer(final BaseMultivariateOptimizer<PAIR>
optimizer,
@@ -75,10 +72,6 @@ public abstract class BaseMultiStartMult
                                                final RandomVectorGenerator generator) {
         super(optimizer.getConvergenceChecker());
 
-        if (optimizer == null ||
-            generator == null) {
-            throw new NullArgumentException();
-        }
         if (starts < 1) {
             throw new NotStrictlyPositiveException(starts);
         }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/univariate/MultiStartUnivariateOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/univariate/MultiStartUnivariateOptimizer.java?rev=1421290&r1=1421289&r2=1421290&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/univariate/MultiStartUnivariateOptimizer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/univariate/MultiStartUnivariateOptimizer.java
Thu Dec 13 13:39:04 2012
@@ -21,7 +21,6 @@ import java.util.Arrays;
 import java.util.Comparator;
 import org.apache.commons.math3.exception.MathIllegalStateException;
 import org.apache.commons.math3.exception.NotStrictlyPositiveException;
-import org.apache.commons.math3.exception.NullArgumentException;
 import org.apache.commons.math3.exception.util.LocalizedFormats;
 import org.apache.commons.math3.random.RandomGenerator;
 import org.apache.commons.math3.optim.MaxEval;
@@ -72,8 +71,6 @@ public class MultiStartUnivariateOptimiz
      * the {@code optimize} methods will return the same solution as
      * {@code optimizer} would.
      * @param generator Random generator to use for restarts.
-     * @throws NullArgumentException if {@code optimizer} or {@code generator}
-     * is {@code null}.
      * @throws NotStrictlyPositiveException if {@code starts < 1}.
      */
     public MultiStartUnivariateOptimizer(final UnivariateOptimizer optimizer,
@@ -81,10 +78,6 @@ public class MultiStartUnivariateOptimiz
                                          final RandomGenerator generator) {
         super(optimizer.getConvergenceChecker());
 
-        if (optimizer == null ||
-            generator == null) {
-            throw new NullArgumentException();
-        }
         if (starts < 1) {
             throw new NotStrictlyPositiveException(starts);
         }



Mime
View raw message