From 135f588ff103020ae0f75b28ff8bcdedd714c1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2EYing-=E5=BA=94=E5=BF=97=E6=B5=A9?= Date: Fri, 14 Apr 2023 15:15:38 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-83195=20=E5=8D=A1=E9=A1=BF=E7=82=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96-=E6=A0=B9=E6=8D=AE=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/carton/SwitchForSwingChecker.java | 5 +++-- .../src/main/java/com/fr/design/worker/save/SaveWorker.java | 2 +- .../java/com/fr/design/worker/save/type/SaveTypeWorker.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/SwitchForSwingChecker.java b/designer-base/src/main/java/com/fr/design/carton/SwitchForSwingChecker.java index 837bdb1c8b..2f884bc301 100644 --- a/designer-base/src/main/java/com/fr/design/carton/SwitchForSwingChecker.java +++ b/designer-base/src/main/java/com/fr/design/carton/SwitchForSwingChecker.java @@ -58,6 +58,7 @@ public class SwitchForSwingChecker implements XMLReadable, XMLWriter { * 简单记录事件执行时间的开关 */ private static boolean easyChecker = false; + /** * 一个标识位用于区分耗时任务时长检测(简单检测)和timer检测 */ @@ -331,7 +332,7 @@ public class SwitchForSwingChecker implements XMLReadable, XMLWriter { MAIN(NORMAL_MAIN_CLASS_NAME) { @Override void initEventQueue() { - if (StringUtils.equals("true", System.getProperty(CARTON_DEVELOPER_JVM_PARAM))) { + if (StringUtils.equals(TURE_JVM, System.getProperty(CARTON_DEVELOPER_JVM_PARAM))) { EventDispatchDeveloperMode.INSTANCE.initMonitoring(); } else { EventDispatchThreadHangMonitor.initMonitoring(); @@ -353,7 +354,7 @@ public class SwitchForSwingChecker implements XMLReadable, XMLWriter { MainClassType(String classPath) { this.classPath = classPath; } - + public static final String TURE_JVM = "true"; String classPath; /** diff --git a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java index cd1fcb3dd0..83b7c50d49 100644 --- a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java @@ -88,7 +88,7 @@ public class SaveWorker extends SwingWorker { this.execute(); // worker纳入管理 WorkerManager.getInstance().registerWorker(taskName, this); - SaveTypeWorker.saveTypePool.execute(() -> { + SaveTypeWorker.SAVE_TYPE_POOL.execute(() -> { while (true) { if (stopWatch.getTime() > TIME_OUT || isDone()) { if (!isDone()) { diff --git a/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java b/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java index b004dea7d2..d415537eb4 100644 --- a/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java @@ -22,7 +22,7 @@ import java.util.concurrent.ExecutorService; */ public class SaveTypeWorker extends SwingWorker { - public static final ExecutorService saveTypePool = FineExecutors.newSingleThreadExecutor(); + public static final ExecutorService SAVE_TYPE_POOL = FineExecutors.newSingleThreadExecutor(); private final Callable callable; @@ -58,7 +58,7 @@ public class SaveTypeWorker extends SwingWorker { StopWatch stopWatch = StopWatch.createStarted(); this.template.setSaving(true); this.execute(); - saveTypePool.execute(() -> { + SAVE_TYPE_POOL.execute(() -> { while (true) { //大于最大等待时间或者worker已经完成该线程都要结束循环 if (stopWatch.getTime() > TIME_OUT || isDone()) {