private static void shortenReference(PsiElement element) throws IncorrectOperationException {
    PsiDocMethodOrFieldRef javadocRef = PsiTreeUtil.getParentOfType(element, PsiDocMethodOrFieldRef.class);
    if (javadocRef != null) {
      element = javadocRef;
    }
    else {
      while (element.getParent() instanceof PsiJavaCodeReferenceElement) {
        element = element.getParent();
      }
    }
    JavaCodeStyleManager codeStyleManagerEx = JavaCodeStyleManager.getInstance(element.getProject());
    codeStyleManagerEx.shortenClassReferences(element, JavaCodeStyleManager.INCOMPLETE_CODE);
  }
private static void shortenReference(PsiElement element)