mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-39088 - IAE: CompositePsiElement.replace
This commit is contained in:
@@ -83,6 +83,9 @@ public class AddTypeCastFix extends LocalQuickFixAndIntentionActionOnPsiElement
|
||||
static PsiExpression createCastExpression(PsiExpression originalExpression, Project project, PsiType type) throws IncorrectOperationException {
|
||||
// remove nested casts
|
||||
PsiElement element = PsiUtil.deparenthesizeExpression(originalExpression);
|
||||
if (element == null){
|
||||
return null;
|
||||
}
|
||||
PsiElementFactory factory = JavaPsiFacade.getInstance(originalExpression.getProject()).getElementFactory();
|
||||
|
||||
PsiTypeCastExpression typeCast = (PsiTypeCastExpression)factory.createExpressionFromText("(Type)value", null);
|
||||
|
||||
Reference in New Issue
Block a user