You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/10/13 16:52:59 UTC

[commons-math] 01/07: sonarfix: Remove transient keyword from non-Serializable class

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit 6ea87d0adccefa929c251c652f1f2cf5790bd833
Author: aherbert <ah...@apache.org>
AuthorDate: Thu Oct 13 17:29:16 2022 +0100

    sonarfix: Remove transient keyword from non-Serializable class
---
 .../math4/legacy/analysis/differentiation/DerivativeStructure.java      | 2 +-
 .../org/apache/commons/math4/legacy/optim/linear/LinearConstraint.java  | 2 +-
 .../commons/math4/legacy/optim/linear/LinearObjectiveFunction.java      | 2 +-
 .../org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java
index d4a3b56dd..7f5493950 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java
@@ -59,7 +59,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class DerivativeStructure implements RealFieldElement<DerivativeStructure> {
     /** Compiler for the current dimensions. */
-    private transient DSCompiler compiler;
+    private DSCompiler compiler;
 
     /** Combined array holding all values. */
     private final double[] data;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearConstraint.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearConstraint.java
index 3ea1fbfe3..82ea6d7f7 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearConstraint.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearConstraint.java
@@ -41,7 +41,7 @@ import org.apache.commons.math4.legacy.linear.RealVector;
  */
 public class LinearConstraint {
     /** Coefficients of the constraint (left hand side). */
-    private final transient RealVector coefficients;
+    private final RealVector coefficients;
     /** Relationship between left and right hand sides {@code (=, <=, >=)}. */
     private final Relationship relationship;
     /** Value of the constraint (right hand side). */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearObjectiveFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearObjectiveFunction.java
index ca117d521..ac88ba981 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearObjectiveFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/LinearObjectiveFunction.java
@@ -37,7 +37,7 @@ public class LinearObjectiveFunction
     implements MultivariateFunction,
                OptimizationData {
     /** Coefficients of the linear equation (c<sub>i</sub>). */
-    private final transient RealVector coefficients;
+    private final RealVector coefficients;
     /** Constant term of the linear equation. */
     private final double constantTerm;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java
index 6bf68f937..16a73ddfc 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java
@@ -94,7 +94,7 @@ class SimplexTableau {
     private final List<String> columnLabels = new ArrayList<>();
 
     /** Simple tableau. */
-    private transient Array2DRowRealMatrix tableau;
+    private Array2DRowRealMatrix tableau;
 
     /** Number of decision variables. */
     private final int numDecisionVariables;