JAL-2480 JAL-2505 guard against duplicating links
[jalview.git] / src / jalview / datamodel / SequenceFeature.java
index c330df9..8eacb68 100755 (executable)
@@ -344,7 +344,10 @@ public class SequenceFeature implements FeatureLocationI
       links = new Vector<String>();
     }
 
-    links.insertElementAt(labelLink, 0);
+    if (!links.contains(labelLink))
+    {
+      links.insertElementAt(labelLink, 0);
+    }
   }
 
   public float getScore()
@@ -553,4 +556,14 @@ public class SequenceFeature implements FeatureLocationI
     }
     return false;
   }
+
+  /**
+   * Answers true if the sequence has zero start and end position
+   * 
+   * @return
+   */
+  public boolean isNonPositional()
+  {
+    return begin == 0 && end == 0;
+  }
 }