JAL-2494 fixed behaviour for null parameters in line with test
[jalview.git] / 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);
       }