From: Jim Procter Date: Wed, 2 Nov 2016 15:33:09 +0000 (+0000) Subject: JAL-1738 JAL-345 fix for JAL-2302 only report Matches that are not contained by the... X-Git-Tag: Release_2_10_1~10^2~6^2~1^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=457deb581a5614633f1c4dd15fee5eeaea5c9758;p=jalview.git JAL-1738 JAL-345 fix for JAL-2302 only report Matches that are not contained by the previous match. --- diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 086765c..ff03788 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -21,6 +21,7 @@ package jalview.analysis; import jalview.datamodel.AlignmentI; +import jalview.datamodel.SearchResultMatchI; import jalview.datamodel.SearchResults; import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; @@ -103,6 +104,7 @@ public class Finder selection = null; } } + SearchResultMatchI lastm = null; while (!found && (seqIndex < end)) { @@ -193,7 +195,6 @@ public class Finder } String noGaps = noGapsSB.toString(); - for (int r = resIndex; r < noGaps.length(); r++) { @@ -216,8 +217,13 @@ public class Finder - 1 + Integer.parseInt(spaces .elementAt(regex.matchedTo() - 1).toString())); - - searchResults.addResult(seq, sres, eres); + // only add result if not contained in previous result + if (lastm == null + || (lastm.getSequence() != seq || (!(lastm.getStart() <= sres && lastm + .getEnd() >= eres)))) + { + lastm = searchResults.addResult(seq, sres, eres); + } hasResults = true; if (!findAll) {