void (@NotNull PsiMethod method, @NotNull PsiType type) { PsiTypeElement typeElement = method.getReturnTypeElement(); Project project = method.getProject(); if (typeElement != null) { JavaCodeStyleManager.getInstance(project) .shortenClassReferences(typeElement.replace(PsiElementFactory.getInstance(project).createTypeElement(type))); } else { addReturnType(project, method, type); } }