[
https://issues.apache.org/jira/browse/MATH-1294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Neidhart resolved MATH-1294.
-----------------------------------
Resolution: Fixed
Fix Version/s: 3.6
4.0
Thanks for the report. It has been fixed in the following commits:
* 3.6: fe23c9b04
* 4.0: 487ac1980
The synchronization is now also on the coefficient list itself (which must be
non-null), and thus there should be a slight performance improvement when
creating different polynomials in multiple threads.
> Data race PolynomialUtils::buildPolynomial
> ------------------------------------------
>
> Key: MATH-1294
> URL: https://issues.apache.org/jira/browse/MATH-1294
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 4.0
> Reporter: Kamil Włodarczyk
> Priority: Minor
> Labels: easyfix, performance
> Fix For: 4.0, 3.6
>
>
> If you run PolynomialUtilsTest methods concurrently there will occur problem
> with ComparisonFailure due to incorrect building of coefficient list.
> https://github.com/apache/commons-math/blob/master/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java#L368
> should be in synchronized block. Explanation: polynomial of given degree can
> be created by other thread and when primary thread access synchronized
> block, there is already created coefficients for this degree, therefore no
> coefficients should be added to coefficients list.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)