From bf5b768c467e6b97a913d5a8a0aba23d9c0abe79 Mon Sep 17 00:00:00 2001 From: vargm Date: Mon, 4 Jul 2022 21:24:15 +0100 Subject: [PATCH] missed commits --- .../gcs/logviewer/AlertLogEntryPanel.java | 8 +++--- .../alert/AlertCheatSheetTableModel.java | 25 +++++++------------ 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/pega/gcs/logviewer/AlertLogEntryPanel.java b/src/main/java/com/pega/gcs/logviewer/AlertLogEntryPanel.java index ff0d530..3e72e16 100644 --- a/src/main/java/com/pega/gcs/logviewer/AlertLogEntryPanel.java +++ b/src/main/java/com/pega/gcs/logviewer/AlertLogEntryPanel.java @@ -18,7 +18,6 @@ import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; -import java.util.Map; import javax.swing.BorderFactory; import javax.swing.JComponent; @@ -279,12 +278,11 @@ public void hyperlinkUpdate(HyperlinkEvent hyperlinkEvent) { } } - AlertMessageListProvider alertMessageListProvider = AlertMessageListProvider.getInstance(); - Map alertMessageMap = alertMessageListProvider.getAlertMessageMap(); - Integer alertId = alertLogEntry.getAlertId(); - AlertMessage alertMessage = alertMessageMap.get(alertId); + AlertMessageListProvider alertMessageListProvider = AlertMessageListProvider.getInstance(); + + AlertMessage alertMessage = alertMessageListProvider.getAlertMessage(alertId); if (alertMessage != null) { diff --git a/src/main/java/com/pega/gcs/logviewer/alert/AlertCheatSheetTableModel.java b/src/main/java/com/pega/gcs/logviewer/alert/AlertCheatSheetTableModel.java index 4ea5f1e..cde4055 100644 --- a/src/main/java/com/pega/gcs/logviewer/alert/AlertCheatSheetTableModel.java +++ b/src/main/java/com/pega/gcs/logviewer/alert/AlertCheatSheetTableModel.java @@ -72,15 +72,13 @@ public int getColumnCount() { @Override public Object getValueAt(int rowIndex, int columnIndex) { - List alertMessageKeyList = getFtmEntryKeyList(); + List alertIdList = getFtmEntryKeyList(); - Integer key = alertMessageKeyList.get(rowIndex); + Integer alertId = alertIdList.get(rowIndex); AlertMessageListProvider alertMessageListProvider = AlertMessageListProvider.getInstance(); - Map alertMessageMap = alertMessageListProvider.getAlertMessageMap(); - - AlertMessage alertMessage = alertMessageMap.get(key); + AlertMessage alertMessage = alertMessageListProvider.getAlertMessage(alertId); String value = getColumnValue(alertMessage, columnIndex); @@ -264,23 +262,18 @@ public SearchModel getSearchModel() { private void initialise() { - List alertMessageKeyList = getFtmEntryKeyList(); + List alertIdList = getFtmEntryKeyList(); AlertMessageListProvider alertMessageListProvider = AlertMessageListProvider.getInstance(); - Map alertMessageMap = alertMessageListProvider.getAlertMessageMap(); - - if (alertMessageMap != null) { + for (String messageId : alertMessageListProvider.getMessageIdSet()) { - for (Map.Entry entry : alertMessageMap.entrySet()) { + AlertMessage alertMessage = alertMessageListProvider.getAlertMessage(messageId); + Integer alertId = alertMessage.getId(); - Integer alertMessageKey = entry.getKey(); - AlertMessage alertMessage = entry.getValue(); + alertIdList.add(alertId); - alertMessageKeyList.add(alertMessageKey); - - updateColumnFilterMap(alertMessageKey, alertMessage); - } + updateColumnFilterMap(alertId, alertMessage); } updateKeyIndexMap();