Lines 28-48
Link Here
|
28 |
*/ |
28 |
*/ |
29 |
public class JavaSearchParticipant extends SearchParticipant { |
29 |
public class JavaSearchParticipant extends SearchParticipant { |
30 |
|
30 |
|
31 |
IndexSelector indexSelector; |
31 |
// IndexSelector indexSelector; |
|
|
32 |
private ThreadLocal indexSelector = new ThreadLocal(); |
32 |
|
33 |
|
33 |
/* (non-Javadoc) |
34 |
/* (non-Javadoc) |
34 |
* @see org.eclipse.jdt.core.search.SearchParticipant#beginSearching() |
35 |
* @see org.eclipse.jdt.core.search.SearchParticipant#beginSearching() |
35 |
*/ |
36 |
*/ |
36 |
public void beginSearching() { |
37 |
public void beginSearching() { |
37 |
super.beginSearching(); |
38 |
super.beginSearching(); |
38 |
this.indexSelector = null; |
39 |
this.indexSelector.set(null); |
39 |
} |
40 |
} |
40 |
|
41 |
|
41 |
/* (non-Javadoc) |
42 |
/* (non-Javadoc) |
42 |
* @see org.eclipse.jdt.core.search.SearchParticipant#doneSearching() |
43 |
* @see org.eclipse.jdt.core.search.SearchParticipant#doneSearching() |
43 |
*/ |
44 |
*/ |
44 |
public void doneSearching() { |
45 |
public void doneSearching() { |
45 |
this.indexSelector = null; |
46 |
this.indexSelector.set(null); |
46 |
super.doneSearching(); |
47 |
super.doneSearching(); |
47 |
} |
48 |
} |
48 |
|
49 |
|
Lines 97-110
Link Here
|
97 |
/* (non-Javadoc) |
98 |
/* (non-Javadoc) |
98 |
* @see org.eclipse.jdt.core.search.SearchParticipant#selectIndexes(org.eclipse.jdt.core.search.SearchQuery, org.eclipse.jdt.core.search.SearchContext) |
99 |
* @see org.eclipse.jdt.core.search.SearchParticipant#selectIndexes(org.eclipse.jdt.core.search.SearchQuery, org.eclipse.jdt.core.search.SearchContext) |
99 |
*/ |
100 |
*/ |
100 |
public IPath[] selectIndexes( |
101 |
public IPath[] selectIndexes(SearchPattern pattern, IJavaSearchScope scope) { |
101 |
SearchPattern pattern, |
|
|
102 |
IJavaSearchScope scope) { |
103 |
|
102 |
|
104 |
if (this.indexSelector == null) { |
103 |
IndexSelector selector = (IndexSelector) this.indexSelector.get(); |
105 |
this.indexSelector = new IndexSelector(scope, pattern); |
104 |
if (selector == null) { |
|
|
105 |
selector = new IndexSelector(scope, pattern); |
106 |
this.indexSelector.set(selector); |
106 |
} |
107 |
} |
107 |
return this.indexSelector.getIndexLocations(); |
108 |
return selector.getIndexLocations(); |
108 |
} |
109 |
} |
109 |
|
110 |
|
110 |
} |
111 |
} |