From 0099f1f88ee8dce45562abdb4ead0cd102c53ec9 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 16 Nov 2021 11:19:03 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62576=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8F=AF=E6=9B=B4=E6=96=B0=E6=8F=90=E9=86=92=E3=80=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A4=8D=E7=94=A8-=E6=9B=B4=E6=96=B0=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E5=8F=96=E6=B6=88=E6=9B=B4=E6=96=B0=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 未处理取消异常 【改动思路】 try-catch块中使用Exception匹配所有异常 --- .../share/ui/block/LocalWidgetUpdater.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java index 65e5fcc94..68a3123f7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java @@ -5,7 +5,6 @@ import com.fr.design.extra.Process; import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.share.collect.ComponentCollector; -import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoUpdater; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import com.fr.design.mainframe.share.util.DownloadUtils; import com.fr.design.mainframe.share.util.ShareComponentUtils; @@ -24,7 +23,6 @@ import java.awt.Component; import java.awt.Container; import java.io.File; import java.io.IOException; -import java.util.concurrent.ExecutionException; /** * @author Starryi @@ -107,7 +105,7 @@ public class LocalWidgetUpdater implements Process { boolean success = false; try { success = get(); - } catch (InterruptedException | ExecutionException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } if (success) { @@ -138,10 +136,11 @@ public class LocalWidgetUpdater implements Process { } public void cancelUpdate() { - if (worker.isDone() || worker.isCancelled()) { - return; + if (worker != null && !worker.isDone()) { + worker.cancel(true); + worker = null; } - worker.cancel(true); + process(-1.0); } @@ -152,7 +151,7 @@ public class LocalWidgetUpdater implements Process { } private void repaintBlockAndOverlay() { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { Container absoluteLayoutParent = getAbsoluteLayoutAncestor(widgetBlock);