Add comment (false positive "sonarcloud" report).
@@ -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) {
