Document () { Document document = com.intellij.reference.SoftReference.dereference(myDocument); if (document == null) { VirtualFile file = getVirtualFile(); document = FileDocumentManager.getInstance().getDocument(file, myManager.getProject()); myDocument = document == null ? null : new SoftReference<>(document); } return document; }