commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1003886 - in /commons/proper/math/branches/MATH_2_X: ./ src/main/java/org/apache/commons/math/analysis/solvers/ src/main/java/org/apache/commons/math/geometry/ src/main/java/org/apache/commons/math/linear/ src/main/java/org/apache/commons/...
Date Sat, 02 Oct 2010 21:04:44 GMT
Author: luc
Date: Sat Oct  2 21:04:44 2010
New Revision: 1003886

URL: http://svn.apache.org/viewvc?rev=1003886&view=rev
Log:
backported part of r1003346 from trunk to branch 2.X
Make immutable private fields final

Modified:
    commons/proper/math/branches/MATH_2_X/   (props changed)
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/analysis/solvers/
  (props changed)
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/linear/Relationship.java
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/RandomAdaptor.java
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/ValueServer.java

Propchange: commons/proper/math/branches/MATH_2_X/
------------------------------------------------------------------------------
    svn:mergeinfo = /commons/proper/math/trunk:1003346

Propchange: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/analysis/solvers/
            ('svn:mergeinfo' removed)

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
Sat Oct  2 21:04:44 2010
@@ -73,7 +73,7 @@ public class Vector3DFormat extends Comp
     private final String trimmedSeparator;
 
     /** The format used for components. */
-    private NumberFormat format;
+    private final NumberFormat format;
 
     /**
      * Create an instance with default settings.

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
Sat Oct  2 21:04:44 2010
@@ -44,7 +44,7 @@ public class OpenMapRealVector extends A
     private final int virtualSize;
 
     /** Tolerance for having a value considered zero. */
-    private double epsilon;
+    private final double epsilon;
 
     /**
      * Build a 0-length vector.

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
Sat Oct  2 21:04:44 2010
@@ -76,7 +76,7 @@ public class RealVectorFormat extends Co
     private final String trimmedSeparator;
 
     /** The format used for components. */
-    private NumberFormat format;
+    private final NumberFormat format;
 
     /**
      * Create an instance with default settings.

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/linear/Relationship.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/linear/Relationship.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/linear/Relationship.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/linear/Relationship.java
Sat Oct  2 21:04:44 2010
@@ -34,7 +34,7 @@ public enum Relationship {
     GEQ(">=");
 
     /** Display string for the relationship. */
-    private String stringValue;
+    private final String stringValue;
 
     /** Simple constructor.
      * @param stringValue display string for the relationship

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
Sat Oct  2 21:04:44 2010
@@ -66,7 +66,7 @@ public class EmpiricalDistributionImpl i
     private static final long serialVersionUID = 5729073523949762654L;
 
     /** List of SummaryStatistics objects characterizing the bins */
-    private List<SummaryStatistics> binStats = null;
+    private final List<SummaryStatistics> binStats;
 
     /** Sample statistics */
     private SummaryStatistics sampleStats = null;
@@ -81,7 +81,7 @@ public class EmpiricalDistributionImpl i
     private double delta = 0d;
 
     /** number of bins */
-    private int binCount = 1000;
+    private final int binCount;
 
     /** is the distribution loaded? */
     private boolean loaded = false;
@@ -90,12 +90,13 @@ public class EmpiricalDistributionImpl i
     private double[] upperBounds = null;
 
     /** RandomData instance to use in repeated calls to getNext() */
-    private RandomData randomData = new RandomDataImpl();
+    private final RandomData randomData = new RandomDataImpl();
 
     /**
      * Creates a new EmpiricalDistribution with the default bin count.
      */
     public EmpiricalDistributionImpl() {
+        binCount = 1000;
         binStats = new ArrayList<SummaryStatistics>();
     }
 

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/RandomAdaptor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/RandomAdaptor.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/RandomAdaptor.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/RandomAdaptor.java
Sat Oct  2 21:04:44 2010
@@ -31,13 +31,13 @@ public class RandomAdaptor extends Rando
     private static final long serialVersionUID = 2306581345647615033L;
 
     /** Wrapped randomGenerator instance */
-    private RandomGenerator randomGenerator = null;
+    private final RandomGenerator randomGenerator;
 
     /**
      * Prevent instantiation without a generator argument
      */
     @SuppressWarnings("unused")
-    private RandomAdaptor() { }
+    private RandomAdaptor() { randomGenerator = null; }
 
     /**
      * Construct a RandomAdaptor wrapping the supplied RandomGenerator.

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/ValueServer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/ValueServer.java?rev=1003886&r1=1003885&r2=1003886&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/ValueServer.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/random/ValueServer.java
Sat Oct  2 21:04:44 2010
@@ -85,12 +85,13 @@ public class ValueServer {
     private BufferedReader filePointer = null;
 
     /** RandomDataImpl to use for random data generation. */
-    private RandomData randomData = new RandomDataImpl();
+    private final RandomData randomData;
 
     // Data generation modes ======================================
 
     /** Creates new ValueServer */
     public ValueServer() {
+        randomData = new RandomDataImpl();
     }
 
     /**



Mime
View raw message