void (@NotNull PsiJavaCodeReferenceElement reference) { super.visitReferenceElement(reference); if (!myImportStatic && reference.getText().equals(reference.getQualifiedName())) { return; } PsiElement parent = reference.getParent(); if (parent instanceof PsiImportStatementBase) { return; } while (parent instanceof PsiJavaCodeReferenceElement) { parent = parent.getParent(); if (parent instanceof PsiImportStatementBase) { return; } } if (myImportStatic) { checkStaticImportReference(reference); } else { checkImportReference(reference); } }