Add comment (false positive "sonarcloud" report).

This commit is contained in:
Gilles Sadowski 2021-07-15 01:42:38 +02:00
parent 73d82834ba
commit dcf83c02a7
1 changed files with 3 additions and 1 deletions

View File

@ -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) {