From d211aa8ae5e8bde93be7f42ab2f23f88464c6e3c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 12 Jul 2016 17:28:55 +0100 Subject: [PATCH] =?utf8?q?JAL-2110=20avoid=20potential=20race=20condition=20?= =?utf8?q?where=20user=20changes=20selection=20after=20=E2=80=98show=20cross?= =?utf8?q?=20refs=E2=80=99=20option=20has=20been=20selected?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/gui/AlignFrame.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3f572e8..04cee93 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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()); -- 1.7.10.2