JAL-2494 fixed behaviour for null parameters in line with test
authorJim Procter <jprocter@issues.jalview.org>
Thu, 27 Apr 2017 15:32:53 +0000 (16:32 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 27 Apr 2017 15:32:53 +0000 (16:32 +0100)
src/jalview/datamodel/Alignment.java

index 17dfb4c..8371036 100755 (executable)
@@ -1642,9 +1642,11 @@ public class Alignment implements AlignmentI
     ArrayList<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
     for (AlignmentAnnotation ann : getAlignmentAnnotation())
     {
-      if (ann.getCalcId() != null && ann.getCalcId().equals(calcId)
-              && ann.sequenceRef != null && ann.sequenceRef == seq
-              && ann.label != null && ann.label.equals(label))
+      if ((calcId == null || (ann.getCalcId() != null && ann.getCalcId()
+              .equals(calcId)))
+              && (seq == null || (ann.sequenceRef != null && ann.sequenceRef == seq))
+              && (label == null || (ann.label != null && ann.label
+                      .equals(label))))
       {
         aa.add(ann);
       }