From ea2f04cb5969de083f901dd8f87f501ef46a638e Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 20 Nov 2015 16:57:08 +0100 Subject: [PATCH] simplify equality for ClsElementInfo: no other kind of info can reference cls psi (EA-73898 - assert: PsiFileImpl.getStubTree) --- .../com/intellij/psi/impl/smartPointers/ClsElementInfo.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/ClsElementInfo.java b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/ClsElementInfo.java index 8c06af3277db..2e9f7af1bbcd 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/ClsElementInfo.java +++ b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/ClsElementInfo.java @@ -16,7 +16,6 @@ package com.intellij.psi.impl.smartPointers; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Segment; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiAnchor; @@ -47,10 +46,7 @@ public class ClsElementInfo extends SmartPointerElementInfo { @Override public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) { - if (other instanceof ClsElementInfo) { - return myStubIndexReference.equals(((ClsElementInfo)other).myStubIndexReference); - } - return Comparing.equal(restoreElement(), other.restoreElement()); + return other instanceof ClsElementInfo && myStubIndexReference.equals(((ClsElementInfo)other).myStubIndexReference); } @Override