From ea6a02880f8587baa985fcb0d43da9617da44176 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 14 Nov 2016 19:04:48 +0300 Subject: [PATCH] EA-88548 - IAE: TObjectHash.throwObjectContractViolation --- .../vcs/changes/actions/diff/ChangeDiffRequestProducer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java index 74ff182f3e92..3e12b05ca98d 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java @@ -90,6 +90,12 @@ public class ChangeDiffRequestProducer implements DiffRequestProducer { } public static boolean isEquals(@NotNull Change change1, @NotNull Change change2) { + if (!Comparing.equal(ChangesUtil.getBeforePath(change1), ChangesUtil.getBeforePath(change2)) || + !Comparing.equal(ChangesUtil.getAfterPath(change1), ChangesUtil.getAfterPath(change2))) { + // we use Change.hashCode(), so removing this check might violate comparison contract + return false; + } + for (ChangeDiffViewerWrapperProvider provider : ChangeDiffViewerWrapperProvider.EP_NAME.getExtensions()) { ThreeState equals = provider.isEquals(change1, change2); if (equals == ThreeState.NO) return false;