Add synchronization to the Standard plugin.

This commit is contained in:
Danila Fedorin 2017-09-10 20:17:49 -07:00
parent 8975bfdb99
commit 7cd117dac1
1 changed files with 1 additions and 2 deletions

View File

@ -696,8 +696,7 @@ public class StandardPlugin extends Plugin {
* @param n non-negative integer.
* @return a number of numClass with value n factorial.
*/
public static NumberInterface factorial(NumberImplementation implementation, int n) {
synchronized public static NumberInterface factorial(NumberImplementation implementation, int n) {
if (!FACTORIAL_LISTS.containsKey(implementation)) {
FACTORIAL_LISTS.put(implementation, new ArrayList<>());
FACTORIAL_LISTS.get(implementation).add(implementation.instanceForString("1"));