public static void cleanupApplicationCaches(Project project) { if (project != null && !project.isDisposed()) { UndoManagerImpl globalInstance = (UndoManagerImpl)UndoManager.getGlobalInstance(); if (globalInstance != null) { globalInstance.dropHistoryInTests(); } ((UndoManagerImpl)UndoManager.getInstance(project)).dropHistoryInTests(); ((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().cleanupForNextTest(); } LocalFileSystemImpl localFileSystem = (LocalFileSystemImpl)LocalFileSystem.getInstance(); if (localFileSystem != null) { localFileSystem.cleanupForNextTest(); } LocalHistoryImpl.getInstanceImpl().cleanupForNextTest(); PatchedWeakReference.clearAll(); }
@NotNull private Getter<FileElement> createTreeElementPointer(@NotNull FileElement treeElement) { if (isKeepTreeElementByHardReference()) { return treeElement; } return myManager.isBatchFilesProcessingMode() ? new PatchedWeakReference<FileElement>(treeElement) : new SoftReference<FileElement>(treeElement); }
private Object createTreeElementPointer(ASTNode treeElement) { if (isKeepTreeElementByHardReference()) { return treeElement; } return myManager.isBatchFilesProcessingMode() ? new PatchedWeakReference<ASTNode>(treeElement) : new SoftReference<ASTNode>(treeElement); }
@Nonnull private Getter<FileElement> createTreeElementPointer(@Nonnull FileElement treeElement) { if (isKeepTreeElementByHardReference()) { return treeElement; } return myManager.isBatchFilesProcessingMode() ? new PatchedWeakReference<>(treeElement) : new SoftReference<>(treeElement); }
public void setDocInfo(@NotNull PsiElement docAnchor, @NotNull PsiElement originalElement) { myDocAnchor = new PatchedWeakReference<PsiElement>(docAnchor); myOriginalElement = new PatchedWeakReference<PsiElement>(originalElement); }
public void setDocInfo(@Nonnull PsiElement docAnchor, @Nonnull PsiElement originalElement) { myDocAnchor = new PatchedWeakReference<PsiElement>(docAnchor); myOriginalElement = new PatchedWeakReference<PsiElement>(originalElement); }