JAL-2480 always include all non-positional features in getAllFeatures()
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 22 May 2017 11:24:56 +0000 (12:24 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 22 May 2017 11:24:56 +0000 (12:24 +0100)
src/jalview/datamodel/features/SequenceFeatures.java
src/jalview/datamodel/features/SequenceFeaturesI.java
test/jalview/datamodel/features/SequenceFeaturesTest.java

index 73ddac7..af99ada 100644 (file)
@@ -120,7 +120,7 @@ public class SequenceFeatures implements SequenceFeaturesI
 
     result.addAll(getPositionalFeatures(type));
 
-    result.addAll(getNonPositionalFeatures(type));
+    result.addAll(getNonPositionalFeatures());
 
     return result;
   }
index ed966e7..281743e 100644 (file)
@@ -33,8 +33,12 @@ public interface SequenceFeaturesI
           String... type);
 
   /**
-   * Answers a list of all features stored, optionally restricted to specified
-   * types, in no particular guaranteed order
+   * Answers a list of all features stored, in no particular guaranteed order.
+   * Positional features may optionally be restricted to specified types, but
+   * all non-positional features (if any) are always returned.
+   * <p>
+   * To filter non-positional features by type, use
+   * getNonPositionalFeatures(type).
    * 
    * @param type
    * @return
index 5ff2d7b..d3927fe 100644 (file)
@@ -689,8 +689,14 @@ public class SequenceFeaturesTest
     features = store.getAllFeatures();
     assertEquals(features.size(), 5);
     assertTrue(features.contains(sf5));
+
+    /*
+     * select by type does not apply to non-positional features
+     */
     features = store.getAllFeatures("Cath");
-    assertTrue(features.isEmpty());
+    assertEquals(features.size(), 1);
+    assertTrue(features.contains(sf3));
+
     features = store.getAllFeatures("Pfam", "Cath", "Metal");
     assertEquals(features.size(), 3);
     assertTrue(features.contains(sf1));