JAL-2046 RFC about cyclic dataset sequence references - should be disallowed ?
[jalview.git] / test / jalview / datamodel / SequenceTest.java
index 3165ec9..ab11c09 100644 (file)
@@ -326,17 +326,20 @@ public class SequenceTest
 
     /*
      * SequenceFeature on dataset sequence only
+     * Note JAL-2046: spurious: we have no use case for setting a non-dataset sequence's feature array to null at the moment.
      */
     sq.setSequenceFeatures(null);
-    sfs = sq.getSequenceFeatures();
-    assertEquals(1, sfs.length);
-    assertSame(sf2, sfs[0]);
+    assertNull(sq.getDatasetSequence().getSequenceFeatures());
 
     /*
      * Corrupt case - no SequenceFeature, dataset's dataset is the original
      * sequence. Test shows no infinite loop results.
      */
     sq.getDatasetSequence().setSequenceFeatures(null);
+    /**
+     * is there a usecase for this ? setDatasetSequence should throw an error if
+     * this actually occurs.
+     */
     sq.getDatasetSequence().setDatasetSequence(sq); // loop!
     assertNull(sq.getSequenceFeatures());
   }