From e837aa274d86db61848aeb6990eaa09c0c1e6a20 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 14 Dec 2018 16:34:01 +0000 Subject: [PATCH] JAL-3171 raise warning when a dataset reference exists *and* a different dataset exists for the sequenceSetID --- src/jalview/project/Jalview2XML.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index 8c3175f..4cc43d3 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -5221,16 +5221,19 @@ public class Jalview2XML jalview.datamodel.AlignmentI ds = getDatasetFor( vamsasSet.getDatasetId()); Vector dseqs = null; - if (ds == null) + if (!ignoreUnrefed) { - if (!ignoreUnrefed) + // recovering an alignment View + AlignmentI seqSetDS = getDatasetFor(UNIQSEQSETID + uniqueSeqSetId); + if (seqSetDS != null) { - // try to resolve the dataset via uniqueSeqSetId - ds = getDatasetFor(UNIQSEQSETID + uniqueSeqSetId); - if (ds != null) + if (ds != null && ds != seqSetDS) { - addDatasetRef(vamsasSet.getDatasetId(), ds); + warn("JAL-3171 regression: Overwriting a dataset reference for an alignment" + + " - CDS/Protein crossreference data may be lost"); } + ds = seqSetDS; + addDatasetRef(vamsasSet.getDatasetId(), ds); } } if (ds == null) -- 1.7.10.2