PsiExpression (@NotNull PsiExpression expression) { if (expression instanceof PsiArrayInitializerExpression) { PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(expression.getProject()); return (PsiExpression)expression.replace(elementFactory.createExpressionFromText("new " + TypeConversionUtil .erasure(expression.getType()).getCanonicalText() + expression.getText(), expression)); } return expression; }