From: Jim Procter Date: Fri, 14 Dec 2018 16:34:01 +0000 (+0000) Subject: JAL-3171 raise warning when a dataset reference exists *and* a different dataset... X-Git-Tag: Release_2_11_1_0~78^2~12 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e837aa274d86db61848aeb6990eaa09c0c1e6a20;p=jalview.git JAL-3171 raise warning when a dataset reference exists *and* a different dataset exists for the sequenceSetID --- 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)