commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r666292 - in /commons/proper/math/branches/MATH_2_0/src: experimental/org/apache/commons/math/function/ experimental/org/apache/commons/math/stat/univariate/ java/org/apache/commons/math/ java/org/apache/commons/math/analysis/ java/org/apac...
Date Tue, 10 Jun 2008 19:32:53 GMT
Author: luc
Date: Tue Jun 10 12:32:52 2008
New Revision: 666292

URL: http://svn.apache.org/viewvc?rev=666292&view=rev
Log:
replaced inefficient use of constructors for Integer, Long, Float and Double
by the recommended static valueOf methods that cache results

Modified:
    commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/function/DefaultContext.java
    commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImpl.java
    commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImplTest.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ArgumentOutsideDomainException.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DimensionMismatchException.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DuplicateSampleAbscissaException.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/FunctionEvaluationException.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/MaxIterationsExceededException.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/complex/ComplexFormat.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/AbstractEstimator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/LevenbergMarquardtEstimator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/fraction/FractionConversionException.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/RandomDataImpl.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/Frequency.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/ContinuedFraction.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/DefaultTransformer.java
    commons/proper/math/branches/MATH_2_0/src/mantissa/src/org/spaceroots/mantissa/algebra/Polynomial.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ConvergenceExceptionTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathExceptionTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/complex/ComplexFormatAbstractTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/fraction/FractionTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/FrequencyTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImpl.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImplTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MixedListUnivariateImplTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/StatisticalSummaryValuesTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/SummaryStatisticsTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/DefaultTransformerTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/TestBean.java

Modified: commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/function/DefaultContext.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/function/DefaultContext.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/function/DefaultContext.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/function/DefaultContext.java Tue Jun 10 12:32:52 2008
@@ -145,19 +145,19 @@
         }
                 
         DefaultValue(double d) {
-            value = new Double(d);
+            value = Double.valueOf(d);
         }
 
         DefaultValue(float f) {
-            value = new Float(f);
+            value = Float.valueOf(f);
         }
 
         DefaultValue(int i) {
-            value = new Integer(i);
+            value = Integer.valueOf(i);
         }
 
         DefaultValue(long l) {
-            value = new Long(l);
+            value = Long.valueOf(l);
         }
         
         /* (non-Javadoc)

Modified: commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImpl.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImpl.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImpl.java Tue Jun 10 12:32:52 2008
@@ -134,7 +134,7 @@
 	    } catch (Exception ex) {              // InstantiationException, IllegalAccessException
 	        throw new RuntimeException(ex);   // should never happen
 	    }
-		dynaBean.set(propertyName, new Double(v));
+		dynaBean.set(propertyName, Double.valueOf(v));
 		addObject(dynaBean);
 	}
 

Modified: commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImplTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImplTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/experimental/org/apache/commons/math/stat/univariate/BeanListUnivariateImplTest.java Tue Jun 10 12:32:52 2008
@@ -60,21 +60,21 @@
         patientList = new ArrayList();
 
         // Create and add patient bean 1
-        VitalStats vs1 = new VitalStats( new Double(120.0), 
-                                         new Double(96.4) );
-        Patient p1 = new Patient( vs1, new Integer( 35 ) );
+        VitalStats vs1 = new VitalStats( Double.valueOf(120.0), 
+                                         Double.valueOf(96.4) );
+        Patient p1 = new Patient( vs1, Integer.valueOf( 35 ) );
         patientList.add( p1 );
 
         // Create and add patient bean 2
-        VitalStats vs2 = new VitalStats( new Double(70.0), 
-                                         new Double(97.4) );
-        Patient p2 = new Patient( vs2, new Integer( 23 ) );
+        VitalStats vs2 = new VitalStats( Double.valueOf(70.0), 
+                                         Double.valueOf(97.4) );
+        Patient p2 = new Patient( vs2, Integer.valueOf( 23 ) );
         patientList.add( p2 );
 
         // Create and add patient bean 3
-        VitalStats vs3 = new VitalStats( new Double(90.0), 
-                                         new Double(98.6) );
-        Patient p3 = new Patient( vs3, new Integer( 42 ) );
+        VitalStats vs3 = new VitalStats( Double.valueOf(90.0), 
+                                         Double.valueOf(98.6) );
+        Patient p3 = new Patient( vs3, Integer.valueOf( 42 ) );
         patientList.add( p3 );
     }
     

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ArgumentOutsideDomainException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ArgumentOutsideDomainException.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ArgumentOutsideDomainException.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ArgumentOutsideDomainException.java Tue Jun 10 12:32:52 2008
@@ -38,7 +38,7 @@
     public ArgumentOutsideDomainException(double argument, double lower, double upper) {
         super(argument,
               "Argument {0} outside domain [{1} ; {2}]",
-              new Object[] { new Double(argument), new Double(lower), new Double(upper) });
+              new Object[] { Double.valueOf(argument), Double.valueOf(lower), Double.valueOf(upper) });
     }
 
 }

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DimensionMismatchException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DimensionMismatchException.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DimensionMismatchException.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DimensionMismatchException.java Tue Jun 10 12:32:52 2008
@@ -35,7 +35,7 @@
     public DimensionMismatchException(int dimension1, int dimension2) {
         super("dimension mismatch {0} != {1}",
               new Object[] {
-                new Integer(dimension1), new Integer(dimension2)
+                Integer.valueOf(dimension1), Integer.valueOf(dimension2)
               });
         this.dimension1 = dimension1;
         this.dimension2 = dimension2;

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DuplicateSampleAbscissaException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DuplicateSampleAbscissaException.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DuplicateSampleAbscissaException.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/DuplicateSampleAbscissaException.java Tue Jun 10 12:32:52 2008
@@ -35,7 +35,7 @@
      */
     public DuplicateSampleAbscissaException(double abscissa, int i1, int i2) {
         super("Abscissa {0} is duplicated at both indices {1} and {2}",
-              new Object[] { new Double(abscissa), new Integer(i1), new Integer(i2) });
+              new Object[] { Double.valueOf(abscissa), Integer.valueOf(i1), Integer.valueOf(i2) });
     }
 
     /**

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/FunctionEvaluationException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/FunctionEvaluationException.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/FunctionEvaluationException.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/FunctionEvaluationException.java Tue Jun 10 12:32:52 2008
@@ -40,7 +40,7 @@
      */
     public FunctionEvaluationException(double argument) {
         super("Evaluation failed for argument = {0}",
-              new Object[] { new Double(argument) });
+              new Object[] { Double.valueOf(argument) });
         this.argument = argument;
     }
     

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/MaxIterationsExceededException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/MaxIterationsExceededException.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/MaxIterationsExceededException.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/MaxIterationsExceededException.java Tue Jun 10 12:32:52 2008
@@ -41,7 +41,7 @@
      */
     public MaxIterationsExceededException(int maxIterations) {
         super("Maximal number of iterations ({0}) exceeded",
-              new Object[] { new Integer(maxIterations) });
+              new Object[] { Integer.valueOf(maxIterations) });
         this.maxIterations = maxIterations;
     }
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java Tue Jun 10 12:32:52 2008
@@ -199,9 +199,9 @@
         if (fa * fb >= 0.0 ) {
             throw new ConvergenceException
             ("Number of iterations={0}, maximum iterations={1}, initial={2}, lower bound={3}, upper bound={4}, final a value={5}, final b value={6}, f(a)={7}, f(b)={8}",
-             new Object[] { new Integer(numIterations), new Integer(maximumIterations),
-                            new Double(initial), new Double(lowerBound), new Double(upperBound),
-                            new Double(a), new Double(b), new Double(fa), new Double(fb) });
+             new Object[] { Integer.valueOf(numIterations), Integer.valueOf(maximumIterations),
+                            Double.valueOf(initial), Double.valueOf(lowerBound), Double.valueOf(upperBound),
+                            Double.valueOf(a), Double.valueOf(b), Double.valueOf(fa), Double.valueOf(fb) });
         }
         
         return new double[]{a, b};

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/complex/ComplexFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/complex/ComplexFormat.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/complex/ComplexFormat.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/complex/ComplexFormat.java Tue Jun 10 12:32:52 2008
@@ -450,7 +450,7 @@
         int endIndex = startIndex + n;
         if (endIndex < source.length()) {
             if (source.substring(startIndex, endIndex).compareTo(sb.toString()) == 0) {
-                ret = new Double(value);
+                ret = Double.valueOf(value);
                 pos.setIndex(endIndex);
             }
         }

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/AbstractEstimator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/AbstractEstimator.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/AbstractEstimator.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/AbstractEstimator.java Tue Jun 10 12:32:52 2008
@@ -98,7 +98,7 @@
 
         if (++costEvaluations > maxCostEval) {
             throw new EstimationException("maximal number of evaluations exceeded ({0})",
-                                          new Object[] { new Integer(maxCostEval) });
+                                          new Object[] { Integer.valueOf(maxCostEval) });
         }
 
         cost = 0;
@@ -202,7 +202,7 @@
         int p = problem.getUnboundParameters().length;
         if (m <= p) {
             throw new EstimationException("no degrees of freedom ({0} measurements, {1} parameters)",
-                                          new Object[] { new Integer(m), new Integer(p)});
+                                          new Object[] { Integer.valueOf(m), Integer.valueOf(p)});
         }
         double[] errors = new double[problem.getUnboundParameters().length];
         final double c = Math.sqrt(getChiSquare(problem) / (m - p));

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/LevenbergMarquardtEstimator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/LevenbergMarquardtEstimator.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/LevenbergMarquardtEstimator.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/estimation/LevenbergMarquardtEstimator.java Tue Jun 10 12:32:52 2008
@@ -401,16 +401,16 @@
           throw new EstimationException("cost relative tolerance is too small ({0})," +
                                         " no further reduction in the" +
                                         " sum of squares is possible",
-                                        new Object[] { new Double(costRelativeTolerance) });
+                                        new Object[] { Double.valueOf(costRelativeTolerance) });
         } else if (delta <= 2.2204e-16 * xNorm) {
           throw new EstimationException("parameters relative tolerance is too small" +
                                         " ({0}), no further improvement in" +
                                         " the approximate solution is possible",
-                                        new Object[] { new Double(parRelativeTolerance) });
+                                        new Object[] { Double.valueOf(parRelativeTolerance) });
         } else if (maxCosine <= 2.2204e-16)  {
           throw new EstimationException("orthogonality tolerance is too small ({0})," +
                                         " solution is orthogonal to the jacobian",
-                                        new Object[] { new Double(orthoTolerance) });
+                                        new Object[] { Double.valueOf(orthoTolerance) });
         }
 
       }
@@ -763,7 +763,7 @@
         }
         if (Double.isInfinite(norm2) || Double.isNaN(norm2)) {
             throw new EstimationException("unable to perform Q.R decomposition on the {0}x{1} jacobian matrix",
-                                          new Object[] { new Integer(rows), new Integer(cols) });
+                                          new Object[] { Integer.valueOf(rows), Integer.valueOf(cols) });
         }
         if (norm2 > ak2) {
           nextColumn = i;

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/fraction/FractionConversionException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/fraction/FractionConversionException.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/fraction/FractionConversionException.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/fraction/FractionConversionException.java Tue Jun 10 12:32:52 2008
@@ -39,7 +39,7 @@
      */
     public FractionConversionException(double value, int maxIterations) {
         super("Unable to convert {0} to fraction after {1} iterations",
-              new Object[] { new Double(value), new Integer(maxIterations) });
+              new Object[] { Double.valueOf(value), Integer.valueOf(maxIterations) });
     }
 
     /**
@@ -51,7 +51,7 @@
      */
     public FractionConversionException(double value, long p, long q) {
         super("Overflow trying to convert {0} to fraction ({1}/{2})",
-              new Object[] { new Double(value), new Long(p), new Long(q) });
+              new Object[] { Double.valueOf(value), Long.valueOf(p), Long.valueOf(q) });
     }
 
 }

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java Tue Jun 10 12:32:52 2008
@@ -198,37 +198,37 @@
           throw new IntegratorException("dimensions mismatch: ODE problem has dimension {0}," +
                                         " initial state vector has dimension {1}",
                                         new Object[] {
-                                          new Integer(equations.getDimension()),
-                                          new Integer(y0.length)
+                                          Integer.valueOf(equations.getDimension()),
+                                          Integer.valueOf(y0.length)
                                         });
       }
       if (equations.getDimension() != y.length) {
           throw new IntegratorException("dimensions mismatch: ODE problem has dimension {0}," +
                                         " final state vector has dimension {1}",
                                         new Object[] {
-                                          new Integer(equations.getDimension()),
-                                          new Integer(y.length)
+                                          Integer.valueOf(equations.getDimension()),
+                                          Integer.valueOf(y.length)
                                         });
       }
       if ((vecAbsoluteTolerance != null) && (vecAbsoluteTolerance.length != y0.length)) {
           throw new IntegratorException("dimensions mismatch: state vector has dimension {0}," +
                                         " absolute tolerance vector has dimension {1}",
                                         new Object[] {
-                                          new Integer(y0.length),
-                                          new Integer(vecAbsoluteTolerance.length)
+                                          Integer.valueOf(y0.length),
+                                          Integer.valueOf(vecAbsoluteTolerance.length)
                                         });
       }
       if ((vecRelativeTolerance != null) && (vecRelativeTolerance.length != y0.length)) {
           throw new IntegratorException("dimensions mismatch: state vector has dimension {0}," +
                                         " relative tolerance vector has dimension {1}",
                                         new Object[] {
-                                          new Integer(y0.length),
-                                          new Integer(vecRelativeTolerance.length)
+                                          Integer.valueOf(y0.length),
+                                          Integer.valueOf(vecRelativeTolerance.length)
                                         });
       }
       if (Math.abs(t - t0) <= 1.0e-12 * Math.max(Math.abs(t0), Math.abs(t))) {
         throw new IntegratorException("too small integration interval: length = {0}",
-                                      new Object[] { new Double(Math.abs(t - t0)) });
+                                      new Object[] { Double.valueOf(Math.abs(t - t0)) });
       }
       
   }
@@ -330,8 +330,8 @@
         throw new IntegratorException("minimal step size ({0}) reached," +
                                       " integration needs {1}",
                                       new Object[] {
-                                        new Double(minStep),
-                                        new Double(Math.abs(h))
+                                        Double.valueOf(minStep),
+                                        Double.valueOf(Math.abs(h))
                                       });
       }
     }

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java Tue Jun 10 12:32:52 2008
@@ -140,21 +140,21 @@
       throw new IntegratorException("dimensions mismatch: ODE problem has dimension {0}," +
                                     " initial state vector has dimension {1}",
                                     new Object[] {
-                                      new Integer(equations.getDimension()),
-                                      new Integer(y0.length)
+                                      Integer.valueOf(equations.getDimension()),
+                                      Integer.valueOf(y0.length)
                                     });
     }
     if (equations.getDimension() != y.length) {
         throw new IntegratorException("dimensions mismatch: ODE problem has dimension {0}," +
                                       " final state vector has dimension {1}",
                                       new Object[] {
-                                        new Integer(equations.getDimension()),
-                                        new Integer(y.length)
+                                        Integer.valueOf(equations.getDimension()),
+                                        Integer.valueOf(y.length)
                                       });
       }
     if (Math.abs(t - t0) <= 1.0e-12 * Math.max(Math.abs(t0), Math.abs(t))) {
       throw new IntegratorException("too small integration interval: length = {0}",
-                                    new Object[] { new Double(Math.abs(t - t0)) });
+                                    new Object[] { Double.valueOf(Math.abs(t - t0)) });
     }      
   }
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java Tue Jun 10 12:32:52 2008
@@ -271,7 +271,7 @@
             double val = 0.0;
             sampleStats = new SummaryStatistics();
             while ((str = inputStream.readLine()) != null) {
-                val = new Double(str).doubleValue();
+                val = Double.valueOf(str).doubleValue();
                 sampleStats.addValue(val);
             }
             inputStream.close();
@@ -334,7 +334,7 @@
         // Load array of bin upper bounds -- evenly spaced from min - max
         double min = sampleStats.getMin();
         double max = sampleStats.getMax();
-        double delta = (max - min)/(new Double(binCount)).doubleValue();
+        double delta = (max - min)/(Double.valueOf(binCount)).doubleValue();
         double[] binUpperBounds = new double[binCount];
         binUpperBounds[0] = min + delta;
         for (int i = 1; i< binCount - 1; i++) {

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/RandomDataImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/RandomDataImpl.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/RandomDataImpl.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/random/RandomDataImpl.java Tue Jun 10 12:32:52 2008
@@ -137,7 +137,7 @@
 
         //Convert each byte to 2 hex digits
         for (int i = 0; i < randomBytes.length; i++) {
-            Integer c = new Integer(randomBytes[i]);
+            Integer c = Integer.valueOf(randomBytes[i]);
 
             /* Add 128 to byte value to make interval 0-255 before
              * doing hex conversion.
@@ -236,7 +236,7 @@
 
             //Loop over the hash, converting each byte to 2 hex digits
             for (int i = 0; i < hash.length; i++) {
-                Integer c = new Integer(hash[i]);
+                Integer c = Integer.valueOf(hash[i]);
 
                 /* Add 128 to byte value to make interval 0-255
                  * This guarantees <= 2 hex digits from toHexString()

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/Frequency.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/Frequency.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/Frequency.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/Frequency.java Tue Jun 10 12:32:52 2008
@@ -30,7 +30,7 @@
  * throw an IllegalArgumentException.</p>
  * <p>
  * Integer values (int, long, Integer, Long) are not distinguished by type -- 
- * i.e. <code>addValue(new Long(2)), addValue(2), addValue(2l)</code> all have
+ * i.e. <code>addValue(Long.valueOf(2)), addValue(2), addValue(2l)</code> all have
  * the same effect (similarly for arguments to <code>getCount,</code> etc.).</p>
  * <p>
  * The values are ordered using the default (natural order), unless a  
@@ -96,14 +96,14 @@
     public void addValue(Object v) {
         Object obj = v;
         if (v instanceof Integer) {
-           obj = new Long(((Integer) v).longValue());
+           obj = Long.valueOf(((Integer) v).longValue());
         }
         try {
             Long count = (Long) freqTable.get(obj);
             if (count == null) {
-                freqTable.put(obj, new Long(1));
+                freqTable.put(obj, Long.valueOf(1));
             } else {
-                freqTable.put(obj, new Long(count.longValue() + 1));
+                freqTable.put(obj, Long.valueOf(count.longValue() + 1));
             }
         } catch (ClassCastException ex) {   
             //TreeMap will throw ClassCastException if v is not comparable
@@ -117,7 +117,7 @@
      * @param v the value to add.
      */
     public void addValue(int v) {
-        addValue(new Long(v));
+        addValue(Long.valueOf(v));
     }
     
     /**
@@ -126,7 +126,7 @@
      * @param v the value to add.
      */
     public void addValue(Integer v) {
-        addValue(new Long(v.longValue()));
+        addValue(Long.valueOf(v.longValue()));
     }
 
     /**
@@ -135,7 +135,7 @@
      * @param v the value to add.
      */
     public void addValue(long v) {
-        addValue(new Long(v));
+        addValue(Long.valueOf(v));
     }
     
     /**
@@ -210,7 +210,7 @@
      * @return the frequency of v.
      */
     public long getCount(int v) {
-        return getCount(new Long(v));
+        return getCount(Long.valueOf(v));
     }
     
     /**
@@ -220,7 +220,7 @@
      * @return the frequency of v.
      */
     public long getCount(long v) {
-        return getCount(new Long(v));
+        return getCount(Long.valueOf(v));
     }
     
     /**
@@ -259,7 +259,7 @@
      * @return the proportion of values equal to v
      */
     public double getPct(int v) {
-        return getPct(new Long(v));       
+        return getPct(Long.valueOf(v));       
     }
     
     /**
@@ -270,7 +270,7 @@
      * @return the proportion of values equal to v
      */
     public double getPct(long v) {
-        return getPct(new Long(v));         
+        return getPct(Long.valueOf(v));         
     }
     
     /**
@@ -345,7 +345,7 @@
      * @return the proportion of values equal to v
      */
     public long getCumFreq(int v) {
-        return getCumFreq(new Long(v));       
+        return getCumFreq(Long.valueOf(v));       
     }
     
      /**
@@ -357,7 +357,7 @@
      * @return the proportion of values equal to v
      */
     public long getCumFreq(long v) {
-        return getCumFreq(new Long(v));         
+        return getCumFreq(Long.valueOf(v));         
     }
     
     /**
@@ -402,7 +402,7 @@
      * @return the proportion of values less than or equal to v
      */
     public double getCumPct(int v) {
-        return getCumPct(new Long(v));       
+        return getCumPct(Long.valueOf(v));       
     }
     
     /**
@@ -415,7 +415,7 @@
      * @return the proportion of values less than or equal to v
      */
     public double getCumPct(long v) {
-        return getCumPct(new Long(v));         
+        return getCumPct(Long.valueOf(v));         
     }
     
     /**

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java Tue Jun 10 12:32:52 2008
@@ -353,7 +353,7 @@
             try {
                 percentileImpl.getClass().getMethod("setQuantile", 
                         new Class[] {Double.TYPE}).invoke(percentileImpl,
-                                new Object[] {new Double(p)});
+                                new Object[] {Double.valueOf(p)});
             } catch (NoSuchMethodException e1) { // Setter guard should prevent
                 throw new IllegalArgumentException(
                    "Percentile implementation does not support setQuantile");
@@ -534,7 +534,7 @@
         try {
             percentileImpl.getClass().getMethod("setQuantile", 
                     new Class[] {Double.TYPE}).invoke(percentileImpl,
-                            new Object[] {new Double(50.0d)});
+                            new Object[] {Double.valueOf(50.0d)});
         } catch (NoSuchMethodException e1) { 
             throw new IllegalArgumentException(
                     "Percentile implementation does not support setQuantile");

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/ContinuedFraction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/ContinuedFraction.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/ContinuedFraction.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/ContinuedFraction.java Tue Jun 10 12:32:52 2008
@@ -155,7 +155,7 @@
                     // can not scale an convergent is unbounded.
                     throw new ConvergenceException(
                         "Continued fraction convergents diverged to +/- infinity for value {0}",
-                        new Object[] { new Double(x) });
+                        new Object[] { Double.valueOf(x) });
                 }
             }
             double r = p2 / q2;
@@ -172,7 +172,7 @@
         if (n >= maxIterations) {
             throw new MaxIterationsExceededException(maxIterations,
                 "Continued fraction convergents failed to converge for value {0}",
-                new Object[] { new Double(x) });
+                new Object[] { Double.valueOf(x) });
         }
 
         return c;

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/DefaultTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/DefaultTransformer.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/DefaultTransformer.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/util/DefaultTransformer.java Tue Jun 10 12:32:52 2008
@@ -52,7 +52,7 @@
         }
             
         try {
-            return new Double(o.toString()).doubleValue();
+            return Double.valueOf(o.toString()).doubleValue();
         } catch (Exception e) {
             throw new MathException("Conversion Exception in Transformation: {0}",
                                     new Object[] { e.getMessage() }, e);

Modified: commons/proper/math/branches/MATH_2_0/src/mantissa/src/org/spaceroots/mantissa/algebra/Polynomial.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/mantissa/src/org/spaceroots/mantissa/algebra/Polynomial.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/mantissa/src/org/spaceroots/mantissa/algebra/Polynomial.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/mantissa/src/org/spaceroots/mantissa/algebra/Polynomial.java Tue Jun 10 12:32:52 2008
@@ -818,7 +818,7 @@
       System.arraycopy((a.length < p.a.length) ? p.a : a,
                        lowLength, newA, lowLength, highLength - lowLength);
 
-      return new Double(newA);
+      return Double.valueOf(newA);
 
     }
 
@@ -845,7 +845,7 @@
         System.arraycopy(a, lowLength, newA, lowLength, highLength - lowLength);
       }
 
-      return new Double(newA);
+      return Double.valueOf(newA);
 
     }
 
@@ -857,7 +857,7 @@
       for (int i = 0; i < a.length; ++i) {
         newA[i] = -a[i];
       }
-      return new Double(newA);
+      return Double.valueOf(newA);
     }
 
     /** Multiply the instance by a polynomial.
@@ -877,7 +877,7 @@
         }
       }
 
-      return new Double(newA);
+      return Double.valueOf(newA);
 
     }
 
@@ -904,14 +904,14 @@
     public Polynomial multiply(double r) {
 
       if (r == 0) {
-        return new Double(new double[] { 0.0 });
+        return Double.valueOf(new double[] { 0.0 });
       }
 
       double[] newA = new double[a.length];
       for (int i = 0; i < a.length; ++i) {
         newA[i] = a[i] * r;
       }
-      return new Double(newA);
+      return Double.valueOf(newA);
 
     }
 
@@ -934,13 +934,13 @@
      */
     public Polynomial getDerivative() {
       if (a.length == 1) {
-        return new Double();
+        return Double.valueOf();
       }
       double[] newA = new double[a.length - 1];
       for (int i = 1; i < a.length; ++i) {
         newA[i - 1] = a[i] * i;
       }
-      return new Double(newA);
+      return Double.valueOf(newA);
     }
 
     /** Returns a string representation of the polynomial.

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ConvergenceExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ConvergenceExceptionTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ConvergenceExceptionTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ConvergenceExceptionTest.java Tue Jun 10 12:32:52 2008
@@ -36,7 +36,7 @@
     
     public void testConstructorPatternArguments(){
         String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
-        Object[] arguments = { new Integer(6), new Integer(4) };
+        Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
         ConvergenceException ex = new ConvergenceException(pattern, arguments);
         assertNull(ex.getCause());
         assertEquals(pattern, ex.getPattern());
@@ -57,7 +57,7 @@
 
     public void testConstructorPatternArgumentsCause(){
         String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
-        Object[] arguments = { new Integer(6), new Integer(4) };
+        Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
         String inMsg = "inner message";
         Exception cause = new Exception(inMsg);
         ConvergenceException ex = new ConvergenceException(pattern, arguments, cause);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java Tue Jun 10 12:32:52 2008
@@ -36,7 +36,7 @@
     
     public void testConstructorPatternArguments(){
         String pattern = "Evaluation failed for argument = {0}";
-        Object[] arguments = { new Double(0.0) };
+        Object[] arguments = { Double.valueOf(0.0) };
         FunctionEvaluationException ex = new FunctionEvaluationException(0.0, pattern, arguments);
         assertNull(ex.getCause());
         assertEquals(pattern, ex.getPattern());
@@ -50,7 +50,7 @@
 
     public void testConstructorPatternArgumentsCause(){
         String pattern = "Evaluation failed for argument = {0}";
-        Object[] arguments = { new Double(0.0) };
+        Object[] arguments = { Double.valueOf(0.0) };
         String inMsg = "inner message";
         Exception cause = new Exception(inMsg);
         FunctionEvaluationException ex = new FunctionEvaluationException(0.0, pattern, arguments, cause);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java Tue Jun 10 12:32:52 2008
@@ -35,7 +35,7 @@
     
     public void testConstructorPatternArguments(){
         String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
-        Object[] arguments = { new Integer(6), new Integer(4) };
+        Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
         MathConfigurationException ex = new MathConfigurationException(pattern, arguments);
         assertNull(ex.getCause());
         assertEquals(pattern, ex.getPattern());
@@ -56,7 +56,7 @@
 
     public void testConstructorPatternArgumentsCause(){
         String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
-        Object[] arguments = { new Integer(6), new Integer(4) };
+        Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
         String inMsg = "inner message";
         Exception cause = new Exception(inMsg);
         MathConfigurationException ex = new MathConfigurationException(pattern, arguments, cause);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathExceptionTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathExceptionTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MathExceptionTest.java Tue Jun 10 12:32:52 2008
@@ -38,7 +38,7 @@
     
     public void testConstructorPatternArguments(){
         String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
-        Object[] arguments = { new Integer(6), new Integer(4) };
+        Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
         MathException ex = new MathException(pattern, arguments);
         assertNull(ex.getCause());
         assertEquals(pattern, ex.getPattern());
@@ -59,7 +59,7 @@
 
     public void testConstructorPatternArgumentsCause(){
         String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
-        Object[] arguments = { new Integer(6), new Integer(4) };
+        Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
         String inMsg = "inner message";
         Exception cause = new Exception(inMsg);
         MathException ex = new MathException(pattern, arguments, cause);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java Tue Jun 10 12:32:52 2008
@@ -39,7 +39,7 @@
         MaxIterationsExceededException ex =
             new MaxIterationsExceededException(1000000,
                 "Continued fraction convergents failed to converge for value {0}",
-                new Object[] { new Double(1234567) });
+                new Object[] { Double.valueOf(1234567) });
         assertNull(ex.getCause());
         assertNotNull(ex.getMessage());
         assertTrue(ex.getMessage().indexOf("1,000,000") < 0);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/complex/ComplexFormatAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/complex/ComplexFormatAbstractTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/complex/ComplexFormatAbstractTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/complex/ComplexFormatAbstractTest.java Tue Jun 10 12:32:52 2008
@@ -334,7 +334,7 @@
     
     public void testFormatNumber() {
         ComplexFormat cf = ComplexFormat.getInstance(getLocale());
-        Double pi = new Double(Math.PI);
+        Double pi = Double.valueOf(Math.PI);
         String text = cf.format(pi);
         assertEquals("3" + getDecimalCharacter() + "14", text);
     }

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/fraction/FractionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/fraction/FractionTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/fraction/FractionTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/fraction/FractionTest.java Tue Jun 10 12:32:52 2008
@@ -515,7 +515,7 @@
         Fraction nullFraction = null;
         assertTrue( zero.equals(zero));
         assertFalse(zero.equals(nullFraction));
-        assertFalse(zero.equals(new Double(0)));
+        assertFalse(zero.equals(Double.valueOf(0)));
         Fraction zero2 = new Fraction(0,2);
         assertTrue(zero.equals(zero2));
         assertEquals(zero.hashCode(), zero2.hashCode());

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java Tue Jun 10 12:32:52 2008
@@ -184,7 +184,7 @@
           double offset = t - middle;
           if (offset > 0) {
             throw new SwitchException("Evaluation failed for argument = {0}",
-                                      new Object[] { new Double(t) });
+                                      new Object[] { Double.valueOf(t) });
           }
           return offset;
         }

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java Tue Jun 10 12:32:52 2008
@@ -202,7 +202,7 @@
                         f.getCount(3) + f.getCount(4) + f.getCount(5);
         long sumFreq = f.getSumFreq();
         double cumPct = 
-            new Double(cumFreq).doubleValue()/new Double(sumFreq).doubleValue();
+            Double.valueOf(cumFreq).doubleValue()/Double.valueOf(sumFreq).doubleValue();
         assertEquals("cum Poisson(4)",cumPct,0.7851,0.2);
         try {
             randomData.nextPoisson(-1);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/FrequencyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/FrequencyTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/FrequencyTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/FrequencyTest.java Tue Jun 10 12:32:52 2008
@@ -71,7 +71,7 @@
         assertEquals("zero cumulative frequency", 0, f.getCumFreq(0));
         assertEquals("one cumulative frequency", 3,  f.getCumFreq(1));
         assertEquals("two cumulative frequency", 4,  f.getCumFreq(2));
-        assertEquals("Integer argument cum freq",4, f.getCumFreq(new Integer(2)));
+        assertEquals("Integer argument cum freq",4, f.getCumFreq(Integer.valueOf(2)));
         assertEquals("five cumulative frequency", 4,  f.getCumFreq(5));
         assertEquals("foo cumulative frequency", 0,  f.getCumFreq("foo"));
         
@@ -92,14 +92,14 @@
         f = null;
         Frequency f = new Frequency();
         f.addValue(1);
-        f.addValue(new Integer(1));
-        f.addValue(new Long(1));
+        f.addValue(Integer.valueOf(1));
+        f.addValue(Long.valueOf(1));
         f.addValue(2);
-        f.addValue(new Integer(-1));
+        f.addValue(Integer.valueOf(-1));
         assertEquals("1 count", 3, f.getCount(1));
-        assertEquals("1 count", 3, f.getCount(new Integer(1)));
+        assertEquals("1 count", 3, f.getCount(Integer.valueOf(1)));
         assertEquals("0 cum pct", 0.2, f.getCumPct(0), tolerance);
-        assertEquals("1 pct", 0.6, f.getPct(new Integer(1)), tolerance);
+        assertEquals("1 pct", 0.6, f.getPct(Integer.valueOf(1)), tolerance);
         assertEquals("-2 cum pct", 0, f.getCumPct(-2), tolerance);
         assertEquals("10 cum pct", 1, f.getCumPct(10), tolerance);   
         
@@ -141,13 +141,13 @@
         f.addValue(3);
         f.addValue(threeI);
         assertEquals("one pct",0.25,f.getPct(1),tolerance);
-        assertEquals("two pct",0.25,f.getPct(new Long(2)),tolerance);
+        assertEquals("two pct",0.25,f.getPct(Long.valueOf(2)),tolerance);
         assertEquals("three pct",0.5,f.getPct(threeL),tolerance);
         assertEquals("five pct",0,f.getPct(5),tolerance);
         assertEquals("foo pct",0,f.getPct("foo"),tolerance);
         assertEquals("one cum pct",0.25,f.getCumPct(1),tolerance);
-        assertEquals("two cum pct",0.50,f.getCumPct(new Long(2)),tolerance);
-        assertEquals("Integer argument",0.50,f.getCumPct(new Integer(2)),tolerance);
+        assertEquals("two cum pct",0.50,f.getCumPct(Long.valueOf(2)),tolerance);
+        assertEquals("Integer argument",0.50,f.getCumPct(Integer.valueOf(2)),tolerance);
         assertEquals("three cum pct",1.0,f.getCumPct(threeL),tolerance);
         assertEquals("five cum pct",1.0,f.getCumPct(5),tolerance);
         assertEquals("zero cum pct",0.0,f.getCumPct(0),tolerance);
@@ -177,13 +177,13 @@
     public void testEmptyTable() {
         assertEquals("freq sum, empty table", 0, f.getSumFreq());
         assertEquals("count, empty table", 0, f.getCount(0));
-        assertEquals("count, empty table",0, f.getCount(new Integer(0)));
+        assertEquals("count, empty table",0, f.getCount(Integer.valueOf(0)));
         assertEquals("cum freq, empty table", 0, f.getCumFreq(0));
         assertEquals("cum freq, empty table", 0, f.getCumFreq("x"));
         assertTrue("pct, empty table", Double.isNaN(f.getPct(0)));
-        assertTrue("pct, empty table", Double.isNaN(f.getPct(new Integer(0))));
+        assertTrue("pct, empty table", Double.isNaN(f.getPct(Integer.valueOf(0))));
         assertTrue("cum pct, empty table", Double.isNaN(f.getCumPct(0)));
-        assertTrue("cum pct, empty table", Double.isNaN(f.getCumPct(new Integer(0))));   
+        assertTrue("cum pct, empty table", Double.isNaN(f.getCumPct(Integer.valueOf(0))));   
     }
     
     /**
@@ -217,18 +217,18 @@
     }
     public void testIntegerValues() {
         Object obj1 = null;
-        obj1 = new Integer(1);
-        Integer int1 = new Integer(1);
+        obj1 = Integer.valueOf(1);
+        Integer int1 = Integer.valueOf(1);
         f.addValue(obj1);
         f.addValue(int1);
         f.addValue(2);
-        f.addValue(new Long(2));
+        f.addValue(Long.valueOf(2));
         assertEquals("Integer 1 count", 2, f.getCount(1));
-        assertEquals("Integer 1 count", 2, f.getCount(new Integer(1)));
-        assertEquals("Integer 1 count", 2, f.getCount(new Long(1)));
+        assertEquals("Integer 1 count", 2, f.getCount(Integer.valueOf(1)));
+        assertEquals("Integer 1 count", 2, f.getCount(Long.valueOf(1)));
         assertEquals("Integer 1 cumPct", 0.5, f.getCumPct(1), tolerance);
-        assertEquals("Integer 1 cumPct", 0.5, f.getCumPct(new Long(1)), tolerance);
-        assertEquals("Integer 1 cumPct", 0.5, f.getCumPct(new Integer(1)), tolerance);
+        assertEquals("Integer 1 cumPct", 0.5, f.getCumPct(Long.valueOf(1)), tolerance);
+        assertEquals("Integer 1 cumPct", 0.5, f.getCumPct(Integer.valueOf(1)), tolerance);
         Iterator it = f.valuesIterator();
         while (it.hasNext()) {
             assertTrue(it.next() instanceof Long);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java Tue Jun 10 12:32:52 2008
@@ -78,7 +78,7 @@
                         // certified value
                         String name = line.substring(0, n).trim();
                         String valueString = line.substring(n + 1).trim();
-                        Double value = new Double(valueString);
+                        Double value = Double.valueOf(valueString);
                         certifiedValues.put(name, value);
                     }
                 }
@@ -138,7 +138,7 @@
             if (meth.getReturnType().equals(Double.TYPE)) {
                 return (Double) property;
             } else if (meth.getReturnType().equals(Long.TYPE)) {
-                return new Double(((Long) property).doubleValue());
+                return Double.valueOf(((Long) property).doubleValue());
             } else {
                 fail("wrong type: " + meth.getReturnType().getName());
             }

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImpl.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImpl.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImpl.java Tue Jun 10 12:32:52 2008
@@ -143,7 +143,7 @@
      * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#addValue(double)
      */
     public void addValue(double v) {
-        list.add(new Double(v));
+        list.add(Double.valueOf(v));
     }
     
     /**

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImplTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImplTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImplTest.java Tue Jun 10 12:32:52 2008
@@ -92,7 +92,7 @@
         assertTrue("Standard Deviation of n = 0 set should be NaN", Double.isNaN( u.getStandardDeviation() ) );
         assertTrue("Variance of n = 0 set should be NaN", Double.isNaN(u.getVariance() ) );
 
-        list.add( new Double(one));
+        list.add( Double.valueOf(one));
 
         assertTrue( "Mean of n = 1 set should be value of single item n1", u.getMean() == one);
         assertTrue( "StdDev of n = 1 set should be zero, instead it is: " + u.getStandardDeviation(), u.getStandardDeviation() == 0);

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MixedListUnivariateImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MixedListUnivariateImplTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MixedListUnivariateImplTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MixedListUnivariateImplTest.java Tue Jun 10 12:32:52 2008
@@ -123,22 +123,22 @@
             new ListUnivariateImpl(new ArrayList<Object>(), transformers);
 
         u.addObject("12.5");
-        u.addObject(new Integer(12));
+        u.addObject(Integer.valueOf(12));
         u.addObject("11.8");
         u.addObject("14.2");
         u.addObject(new Foo());
         u.addObject("14.5");
-        u.addObject(new Long(21));
+        u.addObject(Long.valueOf(21));
         u.addObject("8.2");
         u.addObject("10.3");
         u.addObject("11.3");
-        u.addObject(new Float(14.1));
+        u.addObject(Float.valueOf(14.1f));
         u.addObject("9.9");
         u.addObject("12.2");
         u.addObject(new Bar());
         u.addObject("12.1");
         u.addObject("11");
-        u.addObject(new Double(19.8));
+        u.addObject(Double.valueOf(19.8));
         u.addObject("11");
         u.addObject("10");
         u.addObject("8.8");

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java Tue Jun 10 12:32:52 2008
@@ -217,7 +217,7 @@
         int emptyHash = u.hashCode();
         assertTrue(u.equals(u));
         assertFalse(u.equals(t));
-        assertFalse(u.equals(new Double(0)));
+        assertFalse(u.equals(Double.valueOf(0)));
         t = new MultivariateSummaryStatistics(2, true);
         assertTrue(t.equals(u));
         assertTrue(u.equals(t));

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/StatisticalSummaryValuesTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/StatisticalSummaryValuesTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/StatisticalSummaryValuesTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/StatisticalSummaryValuesTest.java Tue Jun 10 12:32:52 2008
@@ -56,7 +56,7 @@
         StatisticalSummaryValues t = null;
         assertTrue("reflexive", u.equals(u));
         assertFalse("non-null compared to null", u.equals(t));
-        assertFalse("wrong type", u.equals(new Double(0)));
+        assertFalse("wrong type", u.equals(Double.valueOf(0)));
         t = new StatisticalSummaryValues(1, 2, 3, 4, 5, 6);
         assertTrue("instances with same data should be equal", t.equals(u));
         assertEquals("hash code", u.hashCode(), t.hashCode());

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/SummaryStatisticsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/SummaryStatisticsTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/SummaryStatisticsTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/stat/descriptive/SummaryStatisticsTest.java Tue Jun 10 12:32:52 2008
@@ -192,7 +192,7 @@
         int emptyHash = u.hashCode();
         assertTrue("reflexive", u.equals(u));
         assertFalse("non-null compared to null", u.equals(t));
-        assertFalse("wrong type", u.equals(new Double(0)));
+        assertFalse("wrong type", u.equals(Double.valueOf(0)));
         t = createSummaryStatistics();
         assertTrue("empty instances should be equal", t.equals(u));
         assertTrue("empty instances should be equal", u.equals(t));

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/DefaultTransformerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/DefaultTransformerTest.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/DefaultTransformerTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/DefaultTransformerTest.java Tue Jun 10 12:32:52 2008
@@ -31,7 +31,7 @@
      */
     public void testTransformDouble() throws Exception {
         double expected = 1.0;
-        Double input = new Double(expected);
+        Double input = Double.valueOf(expected);
         DefaultTransformer t = new DefaultTransformer();
         assertEquals(expected, t.transform(input), 1.0e-4);
     }
@@ -54,7 +54,7 @@
      */
     public void testTransformInteger() throws Exception {
         double expected = 1.0;
-        Integer input = new Integer(1);
+        Integer input = Integer.valueOf(1);
         DefaultTransformer t = new DefaultTransformer();
         assertEquals(expected, t.transform(input), 1.0e-4);
     }        

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/TestBean.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/TestBean.java?rev=666292&r1=666291&r2=666292&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/TestBean.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/util/TestBean.java Tue Jun 10 12:32:52 2008
@@ -21,7 +21,7 @@
  * @version $Revision$ $Date$
  */
 public class TestBean {
-    private Double x = new Double(1.0);
+    private Double x = Double.valueOf(1.0);
 
     private String y = "1.0";
 



Mime
View raw message