diff --git a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java index fc11f9133a53..8dc5dfd43f8d 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java +++ b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java @@ -775,7 +775,7 @@ public class TypeMigrationLabeler { //do nothing } } - if (myException != null) throw myException; + checkInterrupted(); rememberRootTrace(usageInfo, type, place, alreadyProcessed); if (!alreadyProcessed && !(usageInfo.getElement() instanceof PsiExpression) && !getTypeEvaluator().setType(usageInfo, type)) { alreadyProcessed = true; @@ -785,6 +785,10 @@ public class TypeMigrationLabeler { return alreadyProcessed; } + private void checkInterrupted() { + if (myException != null) throw myException; + } + private void rememberRootTrace(final TypeMigrationUsageInfo usageInfo, final PsiType type, final PsiElement place, final boolean alreadyProcessed) { if (myCurrentRoot != null) { if (!alreadyProcessed) { @@ -1029,9 +1033,7 @@ public class TypeMigrationLabeler { } myDialogSemaphore.waitFor(); - if (myException != null) { - throw myException; - } + checkInterrupted(); } public TypeEvaluator getTypeEvaluator() {