boolean (@NotNull SmartPsiElementPointer<?> pointer1, @NotNull SmartPsiElementPointer<?> pointer2) { if (pointer1 == pointer2) return true; ProgressManager.checkCanceled(); if (pointer1 instanceof SmartPsiElementPointerImpl && pointer2 instanceof SmartPsiElementPointerImpl) { SmartPsiElementPointerImpl<?> impl1 = (SmartPsiElementPointerImpl<?>)pointer1; SmartPsiElementPointerImpl<?> impl2 = (SmartPsiElementPointerImpl<?>)pointer2; SmartPointerElementInfo elementInfo1 = impl1.getElementInfo(); SmartPointerElementInfo elementInfo2 = impl2.getElementInfo(); if (!elementInfo1.pointsToTheSameElementAs(elementInfo2, impl1.myManager)) return false; PsiElement cachedElement1 = impl1.getCachedElement(); PsiElement cachedElement2 = impl2.getCachedElement(); return cachedElement1 == null || cachedElement2 == null || cachedElement1.equals(cachedElement2); } return Comparing.equal(pointer1.getElement(), pointer2.getElement()); }