aherbert commented on code in PR #219:
URL: https://github.com/apache/commons-math/pull/219#discussion_r1003705296


##########
commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java:
##########
@@ -274,9 +274,7 @@ public Complex[] solveAll(Complex[] coefficients, Complex 
initial)
             }
             // Coefficients for deflated polynomial.
             final Complex[] c = new Complex[n + 1];
-            for (int i = 0; i <= n; i++) {
-                c[i] = coefficients[i];
-            }
+            System.arraycopy(coefficients, 0, c, 0, n + 1);

Review Comment:
   I think this may be better as:
   ```Java
   final Complex[] c = coefficients.clone();
   ```



##########
commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LevenbergMarquardtOptimizer.java:
##########
@@ -738,9 +736,9 @@ private double determineLMParameter(double[] qy, double 
delta, double[] diag,
             // if the function is small enough, accept the current value
             // of lmPar, also test for the exceptional cases where parl is zero
             if (JdkMath.abs(fp) <= 0.1 * delta ||
-                (parl == 0 &&
+                 parl == 0 &&

Review Comment:
   Now you have fixed the checkstyle suppressions file, you can revert the 
changes to the parentheses



##########
commons-math-legacy-core/src/main/java/org/apache/commons/math4/legacy/core/dfp/Dfp.java:
##########
@@ -663,8 +663,8 @@ public Dfp getTwo() {
     /** Shift the mantissa left, and adjust the exponent to compensate.
      */
     protected void shiftLeft() {
-        for (int i = mant.length - 1; i > 0; i--) {
-            mant[i] = mant[i - 1];
+        if (mant.length - 1 >= 0) {

Review Comment:
   This is still not updated to use ` > 0`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to