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 f86cb22ef7..433d601c0c 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() + ')'); } }); }