@@ -44,7 +44,6 @@ public abstract class AbstractTextSearchResult implements ISearchResult {
44
44
45
45
private final ConcurrentMap <Object , Set <Match >> fElementsToMatches ;
46
46
private final List <ISearchResultListener > fListeners ;
47
- private final MatchEvent fMatchEvent ;
48
47
private final AtomicInteger matchCount ;
49
48
50
49
private MatchFilter [] fMatchFilters ;
@@ -55,7 +54,6 @@ public abstract class AbstractTextSearchResult implements ISearchResult {
55
54
protected AbstractTextSearchResult () {
56
55
fElementsToMatches = new ConcurrentHashMap <>();
57
56
fListeners = new ArrayList <>();
58
- fMatchEvent = new MatchEvent (this );
59
57
matchCount = new AtomicInteger (0 );
60
58
fMatchFilters = null ; // filtering disabled by default
61
59
}
@@ -145,12 +143,14 @@ public void addMatches(Match[] matches) {
145
143
}
146
144
147
145
private MatchEvent getSearchResultEvent (Match match , int eventKind ) {
146
+ MatchEvent fMatchEvent = new MatchEvent (this );
148
147
fMatchEvent .setKind (eventKind );
149
148
fMatchEvent .setMatch (match );
150
149
return fMatchEvent ;
151
150
}
152
151
153
152
private MatchEvent getSearchResultEvent (Collection <Match > matches , int eventKind ) {
153
+ MatchEvent fMatchEvent = new MatchEvent (this );
154
154
fMatchEvent .setKind (eventKind );
155
155
Match [] matchArray = matches .toArray (new Match [matches .size ()]);
156
156
fMatchEvent .setMatches (matchArray );
0 commit comments