From 3dc414981e662ac1413d4edec477281cdce97d6f Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Sat, 12 Mar 2016 16:57:00 +0100 Subject: [PATCH] treat second and subsequent occurrence calls for the same value as no op (to avoid (de)serialization problems for duplicates like WEB-20651) --- .../core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java b/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java index 749d96344473..61d7d8b061cc 100644 --- a/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java +++ b/platform/core-impl/src/com/intellij/psi/stubs/ObjectStubTree.java @@ -124,6 +124,10 @@ public class ObjectStubTree { } else { int lastZero; for(lastZero = list.length - 1; lastZero >=0 && list[lastZero] == 0; --lastZero); + if (list[lastZero] == myStubIdx) { + // second and subsequent occurrence calls for the same value are no op + return; + } ++lastZero; if (lastZero == list.length) {