void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (element instanceof PsiLiteralExpression) { element.replace(JavaPsiFacade.getElementFactory(project).createExpressionFromText("\"replaced\"", null)); } }