Skip to content

1049: fixed index already disposed in search #1080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,14 @@
public final class AllFilesExceptTestsScope extends GlobalSearchScope {

public static final String SCOPE_NAME = "All Files Except Tests";
private static AllFilesExceptTestsScope instance;
private final Project project;

/**
* Get search scope instance.
*
* @param project Project
*
* @return AllFilesExceptTestsScope
*/
@SuppressWarnings("PMD.AvoidSynchronizedAtMethodLevel")
public static synchronized AllFilesExceptTestsScope getInstance(
final @Nullable Project project
) {
if (instance == null) {
instance = new AllFilesExceptTestsScope(project);
}

return instance;
}

/**
* Magento search scope constructor.
*
* @param project Project
*/
private AllFilesExceptTestsScope(final @Nullable Project project) {
public AllFilesExceptTestsScope(final @Nullable Project project) {
super(project);
this.project = project;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public class MagentoSearchScopesProvider implements SearchScopeProvider {
return Collections.emptyList();
}

return Collections.singletonList(AllFilesExceptTestsScope.getInstance(project));
return Collections.singletonList(new AllFilesExceptTestsScope(project));
}
}