boolean (@NotNull PsiElement element, int start, int end, boolean addImports, boolean incomplete, boolean useFqInJavadoc, boolean useFqInCode) { boolean result = false; if (element instanceof GrQualifiedReference<?> && ((GrQualifiedReference<?>)element).resolve() instanceof PsiClass) { result = shortenReferenceInner((GrQualifiedReference<?>)element, addImports, incomplete, useFqInJavadoc, useFqInCode); } else if (element instanceof GrReferenceExpression && PsiUtil.isSuperReference(((GrReferenceExpression)element).getQualifier())) { result = shortenReferenceInner((GrReferenceExpression)element, addImports, incomplete, useFqInJavadoc, useFqInCode); } PsiElement child = element.getFirstChild(); while (child != null) { final TextRange range = child.getTextRange(); if (start < range.getEndOffset() && range.getStartOffset() < end) { result |= process(child, start, end, addImports, incomplete, useFqInJavadoc, useFqInCode); } child = child.getNextSibling(); } return result; }