mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
chasing the EditorHistoryManagerTest#testSavingStateForNotOpenedEditors
print document to the console: try to keep a not null reference, otherwise, it could have been removed by GC during the dumping
This commit is contained in:
+5
-3
@@ -4,6 +4,7 @@ package com.intellij.openapi.fileEditor.impl;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
import com.intellij.openapi.components.impl.ComponentManagerImpl;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
@@ -45,9 +46,10 @@ public class EditorHistoryManagerTest extends PlatformTestCase {
|
||||
});
|
||||
|
||||
GCUtil.tryGcSoftlyReachableObjects();
|
||||
if (FileDocumentManager.getInstance().getCachedDocument(virtualFile) != null) {
|
||||
String dumpPath = publishHeapDump("EditorHistoryManagerTest");
|
||||
fail("Document wasn't collected, see heap dump at " + dumpPath);
|
||||
Document document = FileDocumentManager.getInstance().getCachedDocument(virtualFile);
|
||||
if (document != null) {
|
||||
fail("Document wasn't collected, see heap dump at " + publishHeapDump(EditorHistoryManagerTest.class.getName()));
|
||||
System.out.println("Keeping a reference to the document: " + document);
|
||||
}
|
||||
|
||||
openProjectPerformTaskCloseProject(dir, project -> {});
|
||||
|
||||
Reference in New Issue
Block a user