From 12fbfe579f0e82934406abfd9c238deccca16759 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 24 Aug 2011 20:26:32 +0200 Subject: [PATCH] do not later perform automatic rename in tests --- .../rename/inplace/VariableInplaceRenamer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index 674d40fb6240..3f696f261d53 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -285,11 +285,16 @@ public class VariableInplaceRenamer { super.templateFinished(template, brokenOff); moveOffsetAfter(!brokenOff); if (myNewName != null) { - ApplicationManager.getApplication().invokeLater(new Runnable() { + final Runnable runnable = new Runnable() { public void run() { performAutomaticRename(myNewName, getVariable()); } - }); + }; + if (ApplicationManager.getApplication().isUnitTestMode()){ + runnable.run(); + } else { + ApplicationManager.getApplication().invokeLater(runnable); + } } }