From ff288dad1994936daa23c5e45f8af2ef20377e43 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 11 Jul 2013 17:40:12 +0200 Subject: [PATCH] increment psi modification count in EDT, in test as well --- .../impl/JavaCodeInsightTestFixtureImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/impl/JavaCodeInsightTestFixtureImpl.java b/java/testFramework/src/com/intellij/testFramework/fixtures/impl/JavaCodeInsightTestFixtureImpl.java index e4d075bc3b62..81ea03c48858 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/impl/JavaCodeInsightTestFixtureImpl.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/impl/JavaCodeInsightTestFixtureImpl.java @@ -26,6 +26,7 @@ import com.intellij.psi.search.ProjectScope; import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture; import com.intellij.testFramework.fixtures.TempDirTestFixture; +import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -88,7 +89,16 @@ public class JavaCodeInsightTestFixtureImpl extends CodeInsightTestFixtureImpl i @Override public void tearDown() throws Exception { - ((PsiModificationTrackerImpl)getPsiManager().getModificationTracker()).incCounter();// drop all caches - super.tearDown(); + try { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + ((PsiModificationTrackerImpl)getPsiManager().getModificationTracker()).incCounter();// drop all caches + } + }); + } + finally { + super.tearDown(); + } } }