From 734fbf22ec94ca02785b9ea1869f798241208525 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 25 Oct 2017 14:58:11 +0100 Subject: [PATCH] JAL-2392 auto boxing rather than explicit Long as key --- src/jalview/gui/ProgressBar.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/jalview/gui/ProgressBar.java b/src/jalview/gui/ProgressBar.java index d7b04ee..011d810 100644 --- a/src/jalview/gui/ProgressBar.java +++ b/src/jalview/gui/ProgressBar.java @@ -126,9 +126,7 @@ public class ProgressBar implements IProgressIndicator @Override public void run() { - final Long longId = Long.valueOf(id); - - JPanel progressPanel = progressBars.get(longId); + JPanel progressPanel = progressBars.get(id); if (progressPanel != null) { /* @@ -139,9 +137,9 @@ public class ProgressBar implements IProgressIndicator { statusBar.setText(message); } - if (progressBarHandlers.containsKey(longId)) + if (progressBarHandlers.containsKey(id)) { - progressBarHandlers.remove(longId); + progressBarHandlers.remove(id); } removeRow(progressPanel); } @@ -160,7 +158,7 @@ public class ProgressBar implements IProgressIndicator addRow(progressPanel); - progressBars.put(longId, progressPanel); + progressBars.put(id, progressPanel); } refreshLayout(); @@ -230,8 +228,7 @@ public class ProgressBar implements IProgressIndicator @Override public void run() { - Long longId = Long.valueOf(id); - final JPanel progressPanel = progressBars.get(longId); + final JPanel progressPanel = progressBars.get(id); if (progressPanel == null) { System.err.println( @@ -247,7 +244,7 @@ public class ProgressBar implements IProgressIndicator return; } - progressBarHandlers.put(longId, handler); + progressBarHandlers.put(id, handler); JButton cancel = new JButton( MessageManager.getString("action.cancel")); cancel.addActionListener(new ActionListener() -- 1.7.10.2