mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
datarace in tests
This commit is contained in:
+1
-2
@@ -43,7 +43,6 @@ import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -218,7 +217,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
if (items.length == 0) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (project.isDisposed()) return;
|
||||
if (project.isDisposed() || !project.isOpen()) return;
|
||||
|
||||
if (indicator != CompletionServiceImpl.getCompletionService().getCurrentCompletion()) return;
|
||||
final Lookup lookup = LookupManager.getActiveLookup(editor);
|
||||
|
||||
+1
@@ -346,6 +346,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
}
|
||||
|
||||
private void cleanup() {
|
||||
assert ApplicationManager.getApplication().isDispatchThread();
|
||||
myHint = null;
|
||||
myOldDocumentText = null;
|
||||
CompletionServiceImpl.getCompletionService().setCurrentCompletion(null);
|
||||
|
||||
@@ -900,6 +900,7 @@ public class LookupImpl extends LightweightHint implements Lookup, Disposable {
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
assert ApplicationManager.getApplication().isDispatchThread();
|
||||
assert myHidden;
|
||||
assert !myDisposed;
|
||||
myDisposed = true;
|
||||
|
||||
+7
-1
@@ -24,6 +24,7 @@ import com.intellij.testFramework.UsefulTestCase;
|
||||
import com.intellij.testFramework.builders.EmptyModuleFixtureBuilder;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
@@ -68,7 +69,7 @@ public abstract class CodeInsightFixtureTestCase extends UsefulTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return absolute path to the test data. Not intended to be overrided.
|
||||
* Return absolute path to the test data. Not intended to be overridden.
|
||||
*
|
||||
* @return absolute path to the test data.
|
||||
*/
|
||||
@@ -88,4 +89,9 @@ public abstract class CodeInsightFixtureTestCase extends UsefulTestCase {
|
||||
protected PsiFile getFile() {
|
||||
return myFixture.getFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void invokeTestRunnable(Runnable runnable) throws Exception {
|
||||
SwingUtilities.invokeAndWait(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -12,6 +12,7 @@ import org.jetbrains.plugins.groovy.CompositeCompletionData;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
|
||||
import org.jetbrains.plugins.groovy.util.TestUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@@ -87,4 +88,9 @@ public abstract class CompletionTestBase extends JavaCodeInsightFixtureTestCase
|
||||
protected boolean addReferenceVariants() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void invokeTestRunnable(Runnable runnable) throws Exception {
|
||||
SwingUtilities.invokeAndWait(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user