[java-refactoring] IntroduceVariableBase: use computeWithAlternativeResolveEnabled

GitOrigin-RevId: 82b6b1ab4bec9b12f65722d6b904ed1cd6ddc54b
This commit is contained in:
Tagir Valeev
2024-06-19 18:12:57 +02:00
committed by intellij-monorepo-bot
parent 0b7995dbd1
commit 2b639d4b80

View File

@@ -341,8 +341,9 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
}
try {
JavaPsiFacade.getElementFactory(project).createTypeElementFromText(
GenericsUtil.getVariableTypeByExpressionType(originalType).getCanonicalText(), expr);
PsiType type = DumbService.getInstance(project)
.computeWithAlternativeResolveEnabled(() -> GenericsUtil.getVariableTypeByExpressionType(originalType));
JavaPsiFacade.getElementFactory(project).createTypeElementFromText(type.getCanonicalText(), expr);
}
catch (IncorrectOperationException ignore) {
String message = RefactoringBundle.getCannotRefactorMessage(JavaRefactoringBundle.message("unknown.expression.type"));