From 6bd43a3305685f558ff39f864031dc943790bae1 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Thu, 25 Jun 2015 16:49:25 +0300 Subject: [PATCH] TypeEvalContextCache improved for PY-16282 according to IDEA-CR-3352. Manager is passed instead of project --- .../python/psi/types/TypeEvalContextCacheImpl.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextCacheImpl.java b/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextCacheImpl.java index 2c7ba1658220..ab40e47309e3 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextCacheImpl.java +++ b/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextCacheImpl.java @@ -15,7 +15,6 @@ */ package com.jetbrains.python.psi.types; -import com.intellij.openapi.project.Project; import com.intellij.psi.util.CachedValue; import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.CachedValuesManager; @@ -33,7 +32,7 @@ import java.util.Map; * * @author Ilya.Kazakevich */ -final class TypeEvalContextCacheImpl implements TypeEvalContextCache { +final class TypeEvalContextCacheImpl implements TypeEvalContextCache { /** * Producer to create map to store cache @@ -47,14 +46,11 @@ final class TypeEvalContextCacheImpl implements TypeEvalContextCache { @NotNull private final Object myLock = new Object(); - /** - * {@link CachedValue} to store/create map [constraints, context] - */ + @NotNull private final CachedValue> myCachedMapStorage; - TypeEvalContextCacheImpl(@NotNull final Project project) { - final CachedValuesManager manager = CachedValuesManager.getManager(project); + TypeEvalContextCacheImpl(@NotNull final CachedValuesManager manager) { myCachedMapStorage = manager.createCachedValue(MAP_CREATOR, false); }