Java 类com.intellij.util.containers.ConcurrentList 实例源码

项目:intellij-ce-playground    文件:ControlFlowFactory.java   
private void registerControlFlow(@NotNull PsiElement element,
                                 @NotNull ControlFlow flow,
                                 boolean evaluateConstantIfCondition,
                                 boolean enableShortCircuit,
                                 @NotNull ControlFlowPolicy policy) {
  final long modificationCount = element.getManager().getModificationTracker().getModificationCount();
  ControlFlowContext controlFlowContext = createContext(evaluateConstantIfCondition, enableShortCircuit, policy, flow, modificationCount);

  ConcurrentList<ControlFlowContext> cached = getOrCreateCachedFlowsForElement(element);
  cached.addIfAbsent(controlFlowContext);
}
项目:intellij-ce-playground    文件:ControlFlowFactory.java   
@NotNull
private ConcurrentList<ControlFlowContext> getOrCreateCachedFlowsForElement(@NotNull PsiElement element) {
  ConcurrentList<ControlFlowContext> cached = cachedFlows.get(element);
  if (cached == null) {
    cached = ContainerUtil.createConcurrentList();
    cachedFlows.put(element, cached);
  }
  return cached;
}
项目:intellij-ce-playground    文件:InjectedLanguageUtil.java   
@NotNull
public static ConcurrentList<DocumentWindow> getCachedInjectedDocuments(@NotNull PsiFile hostPsiFile) {
  // modification of cachedInjectedDocuments must be under PsiLock only
  ConcurrentList<DocumentWindow> injected = hostPsiFile.getUserData(INJECTED_DOCS_KEY);
  if (injected == null) {
    injected =
      ((UserDataHolderEx)hostPsiFile).putUserDataIfAbsent(INJECTED_DOCS_KEY, ContainerUtil.<DocumentWindow>createConcurrentList());
  }
  return injected;
}
项目:consulo    文件:InjectedLanguageUtil.java   
/**
 * @deprecated use {@link InjectedLanguageManager#getCachedInjectedDocumentsInRange(PsiFile, TextRange)} instead
 */
@Nonnull
@Deprecated
public static ConcurrentList<DocumentWindow> getCachedInjectedDocuments(@Nonnull PsiFile hostPsiFile) {
  // modification of cachedInjectedDocuments must be under InjectedLanguageManagerImpl.ourInjectionPsiLock only
  ConcurrentList<DocumentWindow> injected = hostPsiFile.getUserData(INJECTED_DOCS_KEY);
  if (injected == null) {
    injected = ((UserDataHolderEx)hostPsiFile).putUserDataIfAbsent(INJECTED_DOCS_KEY, ContainerUtil.createConcurrentList());
  }
  return injected;
}
项目:consulo-java    文件:ControlFlowFactory.java   
private void registerControlFlow(@NotNull PsiElement element, @NotNull ControlFlow flow, boolean evaluateConstantIfCondition, boolean enableShortCircuit, @NotNull ControlFlowPolicy policy)
{
    final long modificationCount = element.getManager().getModificationTracker().getModificationCount();
    ControlFlowContext controlFlowContext = createContext(evaluateConstantIfCondition, enableShortCircuit, policy, flow, modificationCount);

    ConcurrentList<ControlFlowContext> cached = getOrCreateCachedFlowsForElement(element);
    cached.addIfAbsent(controlFlowContext);
}
项目:consulo-java    文件:ControlFlowFactory.java   
@NotNull
private ConcurrentList<ControlFlowContext> getOrCreateCachedFlowsForElement(@NotNull PsiElement element)
{
    ConcurrentList<ControlFlowContext> cached = cachedFlows.get(element);
    if(cached == null)
    {
        cached = ContainerUtil.createConcurrentList();
        cachedFlows.put(element, cached);
    }
    return cached;
}