mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-203054 Thread leaks in tests
This commit is contained in:
+6
-3
@@ -112,9 +112,12 @@ class MultiThreadSearcher implements SESearcher {
|
||||
* @return {@link ProgressIndicator} that could be used to track and/or cancel searching process
|
||||
*/
|
||||
@Override
|
||||
public ProgressIndicator findMoreItems(Map<SearchEverywhereContributor<?>, Collection<ElementInfo>> alreadyFound, String pattern,
|
||||
boolean useNonProjectItems, SearchEverywhereContributor<?> contributorToExpand, int newLimit,
|
||||
Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier) {
|
||||
public ProgressIndicator findMoreItems(@NotNull Map<SearchEverywhereContributor<?>, Collection<ElementInfo>> alreadyFound,
|
||||
@NotNull String pattern,
|
||||
boolean useNonProjectItems,
|
||||
@NotNull SearchEverywhereContributor<?> contributorToExpand,
|
||||
int newLimit,
|
||||
@NotNull Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier) {
|
||||
ResultsAccumulator accumulator = new ShowMoreResultsAccumulator(alreadyFound, myEqualityProvider, contributorToExpand, newLimit, myListener, myNotificationExecutor);
|
||||
SearchEverywhereContributorFilter<?> filter = filterSupplier.apply(contributorToExpand);
|
||||
ProgressIndicator indicator = new ProgressIndicatorBase();
|
||||
|
||||
@@ -10,13 +10,17 @@ import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
interface SESearcher {
|
||||
ProgressIndicator search(Map<SearchEverywhereContributor<?>, Integer> contributorsAndLimits, String pattern,
|
||||
ProgressIndicator search(@NotNull Map<SearchEverywhereContributor<?>, Integer> contributorsAndLimits,
|
||||
@NotNull String pattern,
|
||||
boolean useNonProjectItems,
|
||||
Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier);
|
||||
@NotNull Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier);
|
||||
|
||||
ProgressIndicator findMoreItems(Map<SearchEverywhereContributor<?>, Collection<ElementInfo>> alreadyFound, String pattern,
|
||||
boolean useNonProjectItems, SearchEverywhereContributor<?> contributorToExpand, int newLimit,
|
||||
Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier);
|
||||
ProgressIndicator findMoreItems(@NotNull Map<SearchEverywhereContributor<?>, Collection<ElementInfo>> alreadyFound,
|
||||
@NotNull String pattern,
|
||||
boolean useNonProjectItems,
|
||||
@NotNull SearchEverywhereContributor<?> contributorToExpand,
|
||||
int newLimit,
|
||||
@NotNull Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier);
|
||||
|
||||
/**
|
||||
* Search process listener interface
|
||||
|
||||
+10
-5
@@ -32,8 +32,10 @@ class SingleThreadSearcher implements SESearcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProgressIndicator search(Map<SearchEverywhereContributor<?>, Integer> contributorsAndLimits, String pattern, boolean useNonProjectItems,
|
||||
Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier) {
|
||||
public ProgressIndicator search(@NotNull Map<SearchEverywhereContributor<?>, Integer> contributorsAndLimits,
|
||||
@NotNull String pattern,
|
||||
boolean useNonProjectItems,
|
||||
@NotNull Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier) {
|
||||
ProgressIndicator indicator = new ProgressIndicatorBase();
|
||||
Runnable task = new SearchTask(contributorsAndLimits, pattern, useNonProjectItems, filterSupplier, indicator, myNotificationExecutor,
|
||||
myNotificationListener, myEqualityProvider);
|
||||
@@ -43,9 +45,12 @@ class SingleThreadSearcher implements SESearcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProgressIndicator findMoreItems(Map<SearchEverywhereContributor<?>, Collection<ElementInfo>> alreadyFound, String pattern,
|
||||
boolean useNonProjectItems, SearchEverywhereContributor<?> contributorToExpand, int newLimit,
|
||||
Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier) {
|
||||
public ProgressIndicator findMoreItems(@NotNull Map<SearchEverywhereContributor<?>, Collection<ElementInfo>> alreadyFound,
|
||||
@NotNull String pattern,
|
||||
boolean useNonProjectItems,
|
||||
@NotNull SearchEverywhereContributor<?> contributorToExpand,
|
||||
int newLimit,
|
||||
@NotNull Function<SearchEverywhereContributor<?>, SearchEverywhereContributorFilter<?>> filterSupplier) {
|
||||
ProgressIndicator indicator = new ProgressIndicatorBase();
|
||||
Runnable task = createShowMoreTask(contributorToExpand, newLimit, pattern, useNonProjectItems, alreadyFound, filterSupplier, indicator);
|
||||
ApplicationManager.getApplication().executeOnPooledThread(ConcurrencyUtil.underThreadNameRunnable("SE-SingleThread-SearchTask", task));
|
||||
|
||||
Reference in New Issue
Block a user