diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index c708960d7e..e7612c0010 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -57,8 +57,6 @@ import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.Timer; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import java.awt.AWTEvent; import java.awt.BorderLayout; import java.awt.Color; @@ -242,21 +240,28 @@ public class AlphaFineDialog extends UIDialog { if (hotData == null) { hotData = HotIssuesManager.getInstance().getHotIssues(); } - for (int i = 0; i < hotData.length; i++) { - panel.add(new HotIssueJpanel(hotData[i], i + 1)); - } } else { hotData = null; - for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { - panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); - } } + initHotPane(panel, hotData); hotPane.add(uiLabel, BorderLayout.NORTH); hotPane.add(panel, BorderLayout.CENTER); add(hotPane, BorderLayout.SOUTH); setSize(AlphaFineConstants.FULL_SIZE); } + private void initHotPane(JPanel panel, String[][] hotData) { + if (hotData == null) { + for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { + panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); + } + } else { + for (int i = 0; i < hotData.length; i++) { + panel.add(new HotIssueJpanel(hotData[i], i + 1)); + } + } + } + /** * 初始化输入框 */ diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java index 6897689b81..749a0a611f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.jetbrains.annotations.Nullable; /** @@ -71,6 +72,7 @@ public class HotIssuesManager { * 从热门问题接口获取热门问题 * @return */ + @Nullable public String[][] getHotIssues() { try { @@ -84,7 +86,7 @@ public class HotIssuesManager { } } } catch (Exception e) { - FineLoggerFactory.getLogger().error("hotissues search error: " + e.getMessage()); + FineLoggerFactory.getLogger().error("hotissues search error: " + e.getMessage(), e); return null; } return data;