mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
debugging flaky WebTreeBuilderPerformanceTest
This commit is contained in:
+6
-3
@@ -144,9 +144,12 @@ class SmartPsiElementPointerImpl<E extends PsiElement> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user