From 492800655568b999a1af945435dda4585e07199f Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 22 May 2020 10:22:06 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-32043=2010.0=E5=86=92=E7=83=9F=EF=BC=9A?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E7=BB=8F=E5=B8=B8?= =?UTF-8?q?=E7=99=BD=E5=B1=8F=EF=BC=8C=E5=8D=A1=E4=BD=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/loghandler/LogHandlerBar.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java index f86cb22ef..433d601c0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java @@ -15,6 +15,11 @@ import static com.fr.design.i18n.Toolkit.i18nText; public class LogHandlerBar extends JPanel implements ItemSelectable { + // 可以作为常量 提前初始化 不用每次都去实时频繁的读取 + private static final String NORMAL_MARK = i18nText("Fine-Design_Basic_NNormal"); + private static final String ALERT_MARK = i18nText("Fine-Design_Basic_Alert"); + private static final String SERIOUSLY_MARK = i18nText("Fine-Design_Basic_Seriously"); + private static final long serialVersionUID = 1L; private ItemListener listeners; private UIButton clear; @@ -75,9 +80,13 @@ public class LogHandlerBar extends JPanel implements ItemSelectable { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - normalLabel.setText(i18nText("Fine-Design_Basic_NNormal") + '(' + getInfo() + ')'); - alertLabel.setText(i18nText("Fine-Design_Basic_Alert") + '(' + getError() + ')'); - seriouslyLabel.setText(i18nText("Fine-Design_Basic_Seriously") + '(' + getServer() + ')'); + // 这块逻辑执行地很频繁 + // 容易造成 AWT 与 FinePluginController 发生死锁 + // in18Text每次读取 资源的时候 都会走下插件引擎逻辑去读取下插件的资源 + // 应该避免每次都去读取 可以作为常量提前初始化好 避免与FinePluginController的竞争 + normalLabel.setText(NORMAL_MARK + '(' + getInfo() + ')'); + alertLabel.setText(ALERT_MARK + '(' + getError() + ')'); + seriouslyLabel.setText(SERIOUSLY_MARK + '(' + getServer() + ')'); } }); }