JAL-2392 auto boxing rather than explicit Long as key
authorJim Procter <jprocter@issues.jalview.org>
Wed, 25 Oct 2017 13:58:11 +0000 (14:58 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 25 Oct 2017 13:58:11 +0000 (14:58 +0100)
src/jalview/gui/ProgressBar.java

index d7b04ee..011d810 100644 (file)
@@ -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()