@@ -44,7 +44,6 @@ public abstract class AbstractTextSearchResult implements ISearchResult {
4444
4545 private final ConcurrentMap <Object , Set <Match >> fElementsToMatches ;
4646 private final List <ISearchResultListener > fListeners ;
47- private final MatchEvent fMatchEvent ;
4847 private final AtomicInteger matchCount ;
4948
5049 private MatchFilter [] fMatchFilters ;
@@ -55,7 +54,6 @@ public abstract class AbstractTextSearchResult implements ISearchResult {
5554 protected AbstractTextSearchResult () {
5655 fElementsToMatches = new ConcurrentHashMap <>();
5756 fListeners = new ArrayList <>();
58- fMatchEvent = new MatchEvent (this );
5957 matchCount = new AtomicInteger (0 );
6058 fMatchFilters = null ; // filtering disabled by default
6159 }
@@ -145,12 +143,14 @@ public void addMatches(Match[] matches) {
145143 }
146144
147145 private MatchEvent getSearchResultEvent (Match match , int eventKind ) {
146+ MatchEvent fMatchEvent = new MatchEvent (this );
148147 fMatchEvent .setKind (eventKind );
149148 fMatchEvent .setMatch (match );
150149 return fMatchEvent ;
151150 }
152151
153152 private MatchEvent getSearchResultEvent (Collection <Match > matches , int eventKind ) {
153+ MatchEvent fMatchEvent = new MatchEvent (this );
154154 fMatchEvent .setKind (eventKind );
155155 Match [] matchArray = matches .toArray (new Match [matches .size ()]);
156156 fMatchEvent .setMatches (matchArray );
0 commit comments