From 35defc43b3098d2e8e427f77fcc49957153625e3 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Mar 2022 15:04:23 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-68780=20BeforeSwicth=E8=A6=81=E7=AD=89st?= =?UTF-8?q?ash=E5=81=9A=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 443a55671d..d6b12efa62 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -24,7 +24,6 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; -import javax.swing.SwingWorker; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -44,7 +43,6 @@ public class HistoryTemplateListCache implements CallbackEvent { private static final int DEAD_LINE = DesignerEnvManager.getEnvManager().getCachingTemplateLimit(); private List> historyList; private JTemplate editingTemplate; - private SwingWorker stashWorker; public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; @@ -342,14 +340,7 @@ public class HistoryTemplateListCache implements CallbackEvent { * @see HistoryTemplateListCache#load() */ public void stash() { - stashWorker = new SwingWorker() { - @Override - protected Boolean doInBackground() throws Exception { - _stash(); - return true; - } - }; - stashWorker.execute(); + _stash(); } private void _stash() { @@ -370,16 +361,6 @@ public class HistoryTemplateListCache implements CallbackEvent { FineLoggerFactory.getLogger().info("Env Change Template Stashed."); } - - private boolean checkStash() { - try { - return stashWorker.get(); - } catch (Exception e) { - FineLoggerFactory.getLogger().debug(e.getMessage(), e); - return false; - } - } - /** * 切换环境前将正在编辑的模板暂存起来后,在新环境重新读取一遍 *

@@ -388,9 +369,6 @@ public class HistoryTemplateListCache implements CallbackEvent { * @see HistoryTemplateListCache#stash() */ public void load() { - if (!checkStash()) { - return; - } FineLoggerFactory.getLogger().info("Env Change Template Loading..."); if (stashFILEMap != null && stashFILEMap.size() != 0) { int size = historyList.size();