JAL-2110 avoid potential race condition where user changes selection after ‘show...
authorJim Procter <jprocter@issues.jalview.org>
Tue, 12 Jul 2016 16:28:55 +0000 (17:28 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 12 Jul 2016 16:28:55 +0000 (17:28 +0100)
src/jalview/gui/AlignFrame.java

index 3f572e8..04cee93 100644 (file)
@@ -4734,13 +4734,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
           AlignmentI xrefsAlignment = makeCrossReferencesAlignment(dataset,
                   xrefs);
-          final SequenceI[] sequenceSelection = AlignFrame.this.viewport
-                  .getSequenceSelection();
           if (!dna)
           {
             xrefsAlignment = AlignmentUtils.makeCdsAlignment(
-                    xrefsAlignment.getSequencesArray(), dataset,
-                    sequenceSelection);
+                    xrefsAlignment.getSequencesArray(), dataset, sel);
             xrefsAlignment.alignAs(alignment);
           }
 
@@ -4773,8 +4770,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           boolean copyAlignmentIsAligned = false;
           if (dna)
           {
-            copyAlignment = AlignmentUtils.makeCdsAlignment(
-                    sequenceSelection, dataset,
+            copyAlignment = AlignmentUtils.makeCdsAlignment(sel, dataset,
                     xrefsAlignment.getSequencesArray());
             if (copyAlignment.getHeight() == 0)
             {
@@ -4795,8 +4791,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           }
           else
           {
-            copyAlignment = AlignmentUtils.makeCopyAlignment(
-                    sequenceSelection, xrefs.getSequencesArray(), dataset);
+            copyAlignment = AlignmentUtils.makeCopyAlignment(sel,
+                    xrefs.getSequencesArray(), dataset);
           }
           copyAlignment.setGapCharacter(AlignFrame.this.viewport
                   .getGapCharacter());