simplify equality for ClsElementInfo: no other kind of info can reference cls psi (EA-73898 - assert: PsiFileImpl.getStubTree)

This commit is contained in:
peter
2015-11-20 17:00:12 +01:00
parent 1fb3d06854
commit ea2f04cb59
@@ -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