JAL-2480 clarify that findOverlaps excludes spanning contact features
[jalview.git] / src / jalview / datamodel / Sequence.java
index 5915d7e..cdfde5c 100755 (executable)
@@ -1826,7 +1826,7 @@ public class Sequence extends ASequence implements SequenceI
     /*
      * if the start or end column is gapped, startPos or endPos may be to the 
      * left or right, and we may have included adjacent or enclosing features;
-     * remove any that are not enclosing, non-contact features
+     * remove any that are not enclosing features
      */
     if (endPos > this.end || Comparison.isGap(sequence[fromColumn - 1])
             || Comparison.isGap(sequence[toColumn - 1]))
@@ -1837,18 +1837,8 @@ public class Sequence extends ASequence implements SequenceI
         SequenceFeature sf = it.next();
         int featureStartColumn = findIndex(sf.getBegin());
         int featureEndColumn = findIndex(sf.getEnd());
-        boolean noOverlap = featureStartColumn > toColumn
-                        || featureEndColumn < fromColumn;
-
-        /*
-         * reject an 'enclosing' feature if it is actually a contact feature
-         */
-        if (sf.isContactFeature() && featureStartColumn < fromColumn
-                && featureEndColumn > toColumn)
-        {
-          noOverlap = true;
-        }
-        if (noOverlap)
+        if (featureStartColumn > toColumn
+                        || featureEndColumn < fromColumn)
         {
           it.remove();
         }