void (@NotNull PsiJavaCodeReferenceElement referenceElement) { if (!isNewDateTimeApiPresent(referenceElement)) { return; } if (PsiTreeUtil.getParentOfType(referenceElement, PsiImportStatementBase.class) != null) { return; } super.visitReferenceElement(referenceElement); final PsiElement target = referenceElement.resolve(); if (!(target instanceof PsiClass targetClass)) return; String qualifiedName = targetClass.getQualifiedName(); if (qualifiedName == null || !dateTimeNames.contains(qualifiedName)) { return; } PsiTypeElement typeElement = PsiTreeUtil.getTopmostParentOfType(referenceElement, PsiTypeElement.class); if (typeElement != null) { final PsiElement parent = typeElement.getParent(); if (parent instanceof PsiMethod method) { if (LibraryUtil.isOverrideOfLibraryMethod(method)) { return; } } else if (parent instanceof PsiParameter parameter) { if (LibraryUtil.isOverrideOfLibraryMethodParameter(parameter)) { return; } } } registerError(referenceElement); }