From 1f6aa70230871e5b434efec4ce4e917ef75dd99d Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 1 Sep 2017 18:33:12 -0700 Subject: [PATCH] Ensure PromotionManager clears its implementation cache. --- core/src/main/java/org/nwapw/abacus/Abacus.java | 1 + .../kotlin/org/nwapw/abacus/number/PromotionManager.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/nwapw/abacus/Abacus.java b/core/src/main/java/org/nwapw/abacus/Abacus.java index c9ecf87..1b1dc49 100644 --- a/core/src/main/java/org/nwapw/abacus/Abacus.java +++ b/core/src/main/java/org/nwapw/abacus/Abacus.java @@ -64,6 +64,7 @@ public class Abacus { pluginManager.addListener(shuntingYardParser); pluginManager.addListener(lexerTokenizer); + pluginManager.addListener(promotionManager); } /** diff --git a/core/src/main/kotlin/org/nwapw/abacus/number/PromotionManager.kt b/core/src/main/kotlin/org/nwapw/abacus/number/PromotionManager.kt index 22e9489..421d642 100644 --- a/core/src/main/kotlin/org/nwapw/abacus/number/PromotionManager.kt +++ b/core/src/main/kotlin/org/nwapw/abacus/number/PromotionManager.kt @@ -6,7 +6,6 @@ import org.nwapw.abacus.plugin.PluginListener import org.nwapw.abacus.plugin.PluginManager import java.util.function.Function -class PromotionManager(val abacus: Abacus) { /** * A class that handles promotions based on priority and the * transition paths each implementation provides. @@ -72,4 +71,13 @@ class PromotionManager(val abacus: Abacus) : PluginListener { }.toTypedArray(), promotedTo = highestPriority) } + override fun onLoad(manager: PluginManager?) { + + } + + override fun onUnload(manager: PluginManager?) { + computePaths.clear() + } + + } \ No newline at end of file