mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[java-refactoring] IntroduceVariableBase: move getCanonicalText() to alternative resolve
May help VarPostfixTemplateTest.testAnonymous flaky test GitOrigin-RevId: d0d1726186d77e2eb24ee4d81f86fdb27fba9e49
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ea589c6c56
commit
9f190c4cad
@@ -341,9 +341,9 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
|
||||
}
|
||||
|
||||
try {
|
||||
PsiType type = DumbService.getInstance(project)
|
||||
.computeWithAlternativeResolveEnabled(() -> GenericsUtil.getVariableTypeByExpressionType(originalType));
|
||||
JavaPsiFacade.getElementFactory(project).createTypeElementFromText(type.getCanonicalText(), expr);
|
||||
String typeText = DumbService.getInstance(project)
|
||||
.computeWithAlternativeResolveEnabled(() -> GenericsUtil.getVariableTypeByExpressionType(originalType).getCanonicalText());
|
||||
JavaPsiFacade.getElementFactory(project).createTypeElementFromText(typeText, expr);
|
||||
}
|
||||
catch (IncorrectOperationException ignore) {
|
||||
String message = RefactoringBundle.getCannotRefactorMessage(JavaRefactoringBundle.message("unknown.expression.type"));
|
||||
|
||||
Reference in New Issue
Block a user