void (@NotNull PsiMember toImport, @NotNull Project project, @NotNull PsiReferenceExpression qualifiedExpression) { PsiClass containingClass = toImport.getContainingClass(); if (containingClass == null) return; PsiReferenceExpression qualifier = JavaPsiFacade.getElementFactory(project).createReferenceExpression(containingClass); qualifiedExpression.setQualifierExpression(qualifier); JavaCodeStyleManager.getInstance(project).shortenClassReferences(qualifiedExpression); }