From 7cd117dac1f440f04767a1502b5db2ce5232a45f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 10 Sep 2017 20:17:49 -0700 Subject: [PATCH] Add synchronization to the Standard plugin. --- core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java b/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java index e144bbc..b3b16f0 100755 --- a/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -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"));