From: Jim Procter Date: Wed, 28 Sep 2016 13:24:48 +0000 (+0100) Subject: JAL-2210 instrument setDBRefs to call ensurePrimaries X-Git-Tag: Release_2_10_0~20^2~31 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1c5971e6df15c0d5c774a2cb7dbdac286a72a9b2;p=jalview.git JAL-2210 instrument setDBRefs to call ensurePrimaries JAL-2210 defer setDBRefs to datasetSequence if available --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 6b57ef7..d295480 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -944,7 +944,17 @@ public class Sequence extends ASequence implements SequenceI @Override public void setDBRefs(DBRefEntry[] dbref) { + if (dbrefs == null && datasetSequence != null + && this != datasetSequence) + { + datasetSequence.setDBRefs(dbref); + return; + } dbrefs = dbref; + if (dbrefs != null) + { + DBRefUtils.ensurePrimaries(this); + } } @Override diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index b7a291e..a29e2ba 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -314,6 +314,14 @@ public interface SequenceI extends ASequenceI public void setVamsasId(String id); + /** + * set the array of Database references for the sequence. + * + * @param dbs + * @deprecated - use is discouraged since side-effects may occur if DBRefEntry + * set are not normalised. + */ + @Deprecated public void setDBRefs(DBRefEntry[] dbs); public DBRefEntry[] getDBRefs();