String (@NonNls String expressionText, PsiElement context) { final Project project = context.getProject(); final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); final PsiElementFactory factory = psiFacade.getElementFactory(); final PsiExpression fromOffsetExpression = factory.createExpressionFromText(expressionText, context); final Object fromOffsetConstant = ExpressionUtils.computeConstantExpression(fromOffsetExpression); if (fromOffsetConstant != null) { return fromOffsetConstant.toString(); } else { return expressionText; } }