String (boolean annotated) { PsiJavaCodeReferenceElement reference = getReference(); if (reference instanceof PsiAnnotatedJavaCodeReferenceElement) { PsiAnnotatedJavaCodeReferenceElement ref = (PsiAnnotatedJavaCodeReferenceElement)reference; PsiAnnotation[] annotations = annotated ? getAnnotations(false) : PsiAnnotation.EMPTY_ARRAY; return ref.getCanonicalText(annotated, annotations.length == 0 ? null : annotations); } return reference.getCanonicalText(); }