From: gmungoc Date: Mon, 10 Sep 2018 09:34:21 +0000 (+0100) Subject: JAL-3108 fix concurrency bug in Reveal action handler X-Git-Tag: Release_2_11_0~17^2~78^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=51e3280b186f53135fd15b9e38ca36d81fb1d2ec;p=jalview.git JAL-3108 fix concurrency bug in Reveal action handler --- diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index e6bba02..5601c7a 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -158,7 +158,12 @@ public class ScalePanel extends JPanel protected void rightMouseButtonPressed(MouseEvent evt, final int res) { JPopupMenu pop = new JPopupMenu(); - if (reveal != null) + + /* + * grab the hidden range in case mouseMoved nulls it + */ + final int[] hiddenRange = reveal; + if (hiddenRange != null) { JMenuItem item = new JMenuItem( MessageManager.getString("label.reveal")); @@ -167,7 +172,7 @@ public class ScalePanel extends JPanel @Override public void actionPerformed(ActionEvent e) { - av.showColumn(reveal[0]); + av.showColumn(hiddenRange[0]); reveal = null; ap.paintAlignment(true, true); av.sendSelection();