JAL-2046 setSequenceFeature contract implementation and warning message
authorJim Procter <jprocter@issues.jalview.org>
Tue, 5 Apr 2016 17:31:32 +0000 (18:31 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 5 Apr 2016 17:45:36 +0000 (18:45 +0100)
src/jalview/datamodel/Sequence.java

index e3746bb..5bfdb04 100755 (executable)
@@ -297,7 +297,16 @@ public class Sequence extends ASequence implements SequenceI
   @Override
   public void setSequenceFeatures(SequenceFeature[] features)
   {
-    sequenceFeatures = features;
+    if (datasetSequence == null)
+    {
+      sequenceFeatures = features;
+    }
+    else
+    {
+      System.err
+              .println("Warning: JAL-2046 side effect ? Possible implementation error: overwriting dataset sequence features by setting sequence features on alignment");
+      datasetSequence.setSequenceFeatures(features);
+    }
   }
 
   @Override