From: Jim Procter Date: Thu, 27 Apr 2017 15:32:53 +0000 (+0100) Subject: JAL-2494 fixed behaviour for null parameters in line with test X-Git-Tag: Release_2_10_2~3^2~123^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e6e38c7d7d2976264065929fcca80db95c06232b;p=jalview.git JAL-2494 fixed behaviour for null parameters in line with test --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 17dfb4c..8371036 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1642,9 +1642,11 @@ public class Alignment implements AlignmentI ArrayList aa = new ArrayList(); 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); }