From a7af34a052c9b8f871de29adeee7a7685ec00b19 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 17 Mar 2017 14:36:36 +0100 Subject: [PATCH] debugging flaky WebTreeBuilderPerformanceTest --- .../impl/smartPointers/SmartPsiElementPointerImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java index af14999892ab..a46a47cdc50c 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java @@ -144,9 +144,12 @@ class SmartPsiElementPointerImpl implements SmartPointerEx @NotNull E element, PsiFile containingFile, boolean forInjected) { SmartPointerElementInfo elementInfo = doCreateElementInfo(project, element, containingFile, forInjected); - if (ApplicationManager.getApplication().isUnitTestMode() && !element.equals(elementInfo.restoreElement())) { - // likely cause: PSI having isPhysical==true, but which can't be restored by containing file and range. To fix, make isPhysical return false - LOG.error("Cannot restore " + element + " of " + element.getClass() + " from " + elementInfo); + if (ApplicationManager.getApplication().isUnitTestMode()) { + PsiElement restored = elementInfo.restoreElement(); + if (!element.equals(restored)) { + // likely cause: PSI having isPhysical==true, but which can't be restored by containing file and range. To fix, make isPhysical return false + LOG.error("Cannot restore " + element + " of " + element.getClass() + " from " + elementInfo + "; restored=" + restored + " in " + element.getProject()); + } } return elementInfo; }