getDBRefs now always returns DBRefArray if it exists on this sequence or dataset...
authorjprocter <Jim Procter>
Wed, 6 Aug 2008 12:14:06 +0000 (12:14 +0000)
committerjprocter <Jim Procter>
Wed, 6 Aug 2008 12:14:06 +0000 (12:14 +0000)
src/jalview/datamodel/Sequence.java

index 3240f84..56a829c 100755 (executable)
@@ -185,15 +185,16 @@ public class Sequence implements SequenceI
         addSequenceFeature(new SequenceFeature(sf[i]));
       }
     }
-    if (seq.getDBRef() != null)
+    setDatasetSequence(seq.getDatasetSequence());
+    if (datasetSequence==null && seq.getDBRef() != null)
     {
+      // only copy DBRefs if we really are a dataset sequence
       DBRefEntry[] dbr = seq.getDBRef();
       for (int i = 0; i < dbr.length; i++)
       {
         addDBRef(new DBRefEntry(dbr[i]));
       }
     }
-    setDatasetSequence(seq.getDatasetSequence());
     if (seq.getAnnotation() != null)
     {
       AlignmentAnnotation[] sqann = seq.getAnnotation();
@@ -819,6 +820,10 @@ public class Sequence implements SequenceI
 
   public DBRefEntry[] getDBRef()
   {
+    if (dbrefs==null && datasetSequence!=null && this!=datasetSequence)
+    {
+      return datasetSequence.getDBRef();
+    }
     return dbrefs;
   }