From e6e38c7d7d2976264065929fcca80db95c06232b Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 27 Apr 2017 16:32:53 +0100 Subject: [PATCH] JAL-2494 fixed behaviour for null parameters in line with test --- src/jalview/datamodel/Alignment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } -- 1.7.10.2