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

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


The following commit(s) were added to refs/heads/master by this push:
     new dcf83c0  Add comment (false positive "sonarcloud" report).
dcf83c0 is described below

commit dcf83c02a7a341ce40d02521a9e8d4cb863e4728
Author: Gilles Sadowski <gillese...@gmail.com>
AuthorDate: Thu Jul 15 01:42:38 2021 +0200

    Add comment (false positive "sonarcloud" report).
---
 .../commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
index 44da4c1..6430d31 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
@@ -366,7 +366,9 @@ public final class PolynomialsUtils {
     private static PolynomialFunction buildPolynomial(final int degree,
                                                       final List<BigFraction> 
coefficients,
                                                       final 
RecurrenceCoefficientsGenerator generator) {
-
+        // Synchronizing on a method parameter is not safe; however, in this
+        // case, the lock object is an immutable field that belongs to this
+        // class.
         synchronized (coefficients) {
             final int maxDegree = (int) AccurateMath.floor(AccurateMath.sqrt(2 
* coefficients.size())) - 1;
             if (degree > maxDegree) {

Reply via email to