Java 类com.intellij.util.PatchedWeakReference 实例源码

项目:tools-idea    文件:PlatformTestCase.java   
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();
}
项目:intellij-ce-playground    文件:PsiFileImpl.java   
@NotNull
private Getter<FileElement> createTreeElementPointer(@NotNull FileElement treeElement) {
  if (isKeepTreeElementByHardReference()) {
    return treeElement;
  }
  return myManager.isBatchFilesProcessingMode()
               ? new PatchedWeakReference<FileElement>(treeElement)
               : new SoftReference<FileElement>(treeElement);
}
项目:tools-idea    文件:PsiFileImpl.java   
private Object createTreeElementPointer(ASTNode treeElement) {
  if (isKeepTreeElementByHardReference()) {
    return treeElement;
  }
  return myManager.isBatchFilesProcessingMode()
               ? new PatchedWeakReference<ASTNode>(treeElement)
               : new SoftReference<ASTNode>(treeElement);
}
项目:consulo    文件:PsiFileImpl.java   
@Nonnull
private Getter<FileElement> createTreeElementPointer(@Nonnull FileElement treeElement) {
  if (isKeepTreeElementByHardReference()) {
    return treeElement;
  }
  return myManager.isBatchFilesProcessingMode()
         ? new PatchedWeakReference<>(treeElement)
         : new SoftReference<>(treeElement);
}
项目:intellij-ce-playground    文件:AbstractDocumentationTooltipAction.java   
public void setDocInfo(@NotNull PsiElement docAnchor, @NotNull PsiElement originalElement) {
  myDocAnchor = new PatchedWeakReference<PsiElement>(docAnchor);
  myOriginalElement = new PatchedWeakReference<PsiElement>(originalElement);
}
项目:tools-idea    文件:AbstractDocumentationTooltipAction.java   
public void setDocInfo(@NotNull PsiElement docAnchor, @NotNull PsiElement originalElement) {
  myDocAnchor = new PatchedWeakReference<PsiElement>(docAnchor);
  myOriginalElement = new PatchedWeakReference<PsiElement>(originalElement);
}
项目:consulo    文件:AbstractDocumentationTooltipAction.java   
public void setDocInfo(@Nonnull PsiElement docAnchor, @Nonnull PsiElement originalElement) {
  myDocAnchor = new PatchedWeakReference<PsiElement>(docAnchor);
  myOriginalElement = new PatchedWeakReference<PsiElement>(originalElement);
}