From 1dc48debd7936bf0bfe0c072cbf82195a0befc0f Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Wed, 28 Sep 2022 17:45:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-80940=20IOFileAttrMark=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E5=90=8E=E6=9C=AA=E5=88=B7=E6=96=B0=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=90=8E=E5=88=B7=E6=96=B0=EF=BC=9B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?AttrMap=E4=B8=ADkey=E6=A0=87=E7=AD=BE=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 33 +++---------------- 1 file changed, 4 insertions(+), 29 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 c00f8bb44..f6a97428e 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 @@ -446,13 +446,10 @@ public class HistoryTemplateListCache implements CallbackEvent { for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); FILE file = template.getEditingFILE(); - boolean needReload = context == null || needReloadTemplate(context, template); - if (needReload) { - FILE stashFile = template.templateToStashFile(); - if (stashFile != null) { - FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); - template.refreshResource(stashFile); - } + FILE stashFile = template.templateToStashFile(); + if (stashFile != null) { + FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); + template.refreshResource(stashFile); } } FineLoggerFactory.getLogger().info("Plugin env change reload all template ended"); @@ -474,28 +471,6 @@ public class HistoryTemplateListCache implements CallbackEvent { _reloadAllEditingTemplate(null); } - private boolean needReloadTemplate(PluginContext context, JTemplate template) { - BaseBook baseBook = template.getTarget(); - if (baseBook != null) { - String name = template.getEditingFILE().getName(); - String pluginId = context.getID(); - long start = System.currentTimeMillis(); - Set set = ClassHelper.getClassLoadersByFilter(baseBook, ClassFilter.getInstance()); - FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); - if (set != null) { - for (ClassLoader classLoader : set) { - if (ComparatorUtils.equals(pluginId, PluginManager.detectLeakingPlugin(classLoader))) { - return true; - } - } - } else { - // set为null说明 检测classloader 这里返回true直接刷新 兜底行为 - return true; - } - } - return false; - } - public void replaceCurrentEditingTemplate(JTemplate jt) { int index = contains(this.editingTemplate); this.editingTemplate = jt; From 73f15873a37da38134bebf60dddc12d46a0a8070 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 29 Sep 2022 10:09:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-80940=20IOFileAttrMark=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E5=90=8E=E6=9C=AA=E5=88=B7=E6=96=B0=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=90=8E=E5=88=B7=E6=96=B0=EF=BC=9B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?AttrMap=E4=B8=ADkey=E6=A0=87=E7=AD=BE=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/HistoryTemplateListCache.java | 2 ++ 1 file changed, 2 insertions(+) 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 f6a97428e..3d23b3162 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 @@ -445,6 +445,8 @@ public class HistoryTemplateListCache implements CallbackEvent { int size = historyList.size(); for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); + // 判断刷新逻辑比较耗时,且可能出现插件安装后误判导致不刷新 + // 插件安装/启用场景比较少,因此插件安装/启用后每次均进行刷新 FILE file = template.getEditingFILE(); FILE stashFile = template.templateToStashFile(); if (stashFile != null) {