void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); assert isJavaTypeElement(element); PsiTypeElement stringTypeElement = PsiElementFactory.getInstance(project) .createTypeElementFromText(myText, element.getContext()); JavaCodeStyleManager.getInstance(project) .shortenClassReferences(element.replace(stringTypeElement)); }