JAL-4091 JAL-629 ‘Add Reference Annotations’ takes description into account when...
[jalview.git] / src / jalview / analysis / AlignmentUtils.java
index 42c4b76..0906872 100644 (file)
@@ -1471,9 +1471,19 @@ public class AlignmentUtils
          */
         final Iterable<AlignmentAnnotation> matchedAlignmentAnnotations = al
                 .findAnnotations(seq, dsann.getCalcId(), dsann.label);
-        if (matchedAlignmentAnnotations == null
-                || !matchedAlignmentAnnotations.iterator().hasNext())
+        boolean found=false;
+        if (matchedAlignmentAnnotations != null)
         {
+          for (AlignmentAnnotation matched:matchedAlignmentAnnotations)
+          {
+            if (dsann.description.equals(matched.description))
+            {
+              found=true;
+              break;
+            }
+          }
+        }
+        if (!found) {
           result.add(dsann);
           if (labelForCalcId != null)
           {