mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
deprecation removed
This commit is contained in:
@@ -24,6 +24,7 @@ import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.NullableFunction;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -53,7 +54,7 @@ public class DfaUtil {
|
||||
CachedValue<MultiValuesMap<PsiVariable, PsiExpression>> cachedValue = context.getUserData(DFA_VARIABLE_INFO_KEY);
|
||||
if (cachedValue == null) {
|
||||
final PsiElement codeBlock = getEnclosingCodeBlock(variable, context);
|
||||
cachedValue = context.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<MultiValuesMap<PsiVariable, PsiExpression>>() {
|
||||
cachedValue = CachedValuesManager.getManager(context.getProject()).createCachedValue(new CachedValueProvider<MultiValuesMap<PsiVariable, PsiExpression>>() {
|
||||
public Result<MultiValuesMap<PsiVariable, PsiExpression>> compute() {
|
||||
final MultiValuesMap<PsiVariable, PsiExpression> result;
|
||||
if (codeBlock == null) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ElementPresentationUtil {
|
||||
|
||||
CachedValue<Integer> value = aClass.getUserData(CLASS_KIND_KEY);
|
||||
if (value == null) {
|
||||
value = aClass.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<Integer>() {
|
||||
value = CachedValuesManager.getManager(aClass.getProject()).createCachedValue(new CachedValueProvider<Integer>() {
|
||||
public Result<Integer> compute() {
|
||||
return Result.createSingleDependency(Integer.valueOf(getClassKindImpl(aClass)), aClass);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public class PsiClassImplUtil {
|
||||
CachedValue<Map> value = aClass.getUserData(MAP_IN_CLASS_KEY);
|
||||
if (value == null) {
|
||||
final CachedValueProvider<Map> provider = new ByNameCachedValueProvider(aClass);
|
||||
value = aClass.getManager().getCachedValuesManager().createCachedValue(provider, false);
|
||||
value = CachedValuesManager.getManager(aClass.getProject()).createCachedValue(provider, false);
|
||||
//Do not cache for nonphysical elements
|
||||
if (aClass.isPhysical()) {
|
||||
value = ((UserDataHolderEx)aClass).putUserDataIfAbsent(MAP_IN_CLASS_KEY, value);
|
||||
|
||||
@@ -276,7 +276,7 @@ public class PsiSuperMethodImplUtil {
|
||||
CachedValue<Map<MethodSignature, HierarchicalMethodSignature>> value = aClass.getUserData(SIGNATURES_KEY);
|
||||
if (value == null) {
|
||||
BySignaturesCachedValueProvider provider = new BySignaturesCachedValueProvider(aClass);
|
||||
value = aClass.getManager().getCachedValuesManager().createCachedValue(provider, false);
|
||||
value = CachedValuesManager.getManager(aClass.getProject()).createCachedValue(provider, false);
|
||||
//Do not cache for nonphysical elements
|
||||
if (aClass.isPhysical()) {
|
||||
UserDataHolderEx dataHolder = (UserDataHolderEx)aClass;
|
||||
|
||||
+3
-5
@@ -27,10 +27,7 @@ import com.intellij.openapi.util.ModificationTracker;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiManagerEx;
|
||||
import com.intellij.psi.impl.PsiParameterizedCachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.ParameterizedCachedValue;
|
||||
import com.intellij.psi.util.ParameterizedCachedValueProvider;
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -137,7 +134,8 @@ public class JavaConcatenationInjectorManager implements ProjectComponent, Modif
|
||||
|
||||
if (registrar.result != null) {
|
||||
// store this everywhere
|
||||
ParameterizedCachedValue<Places, PsiElement> cachedValue = context.getManager().getCachedValuesManager().createParameterizedCachedValue(this, false);
|
||||
ParameterizedCachedValue<Places, PsiElement> cachedValue =
|
||||
CachedValuesManager.getManager(context.getProject()).createParameterizedCachedValue(this, false);
|
||||
((PsiParameterizedCachedValue<Places, PsiElement>)cachedValue).setValue(result);
|
||||
|
||||
for (PsiElement operand : operands) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.intellij.psi.meta.MetaDataRegistrar;
|
||||
import com.intellij.psi.meta.PsiMetaData;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -51,8 +52,7 @@ public class MetaRegistry extends MetaDataRegistrar {
|
||||
private static final Key<CachedValue<PsiMetaData>> META_DATA_KEY = Key.create("META DATA KEY");
|
||||
|
||||
public static void bindDataToElement(final PsiElement element, final PsiMetaData data) {
|
||||
CachedValue<PsiMetaData> value =
|
||||
element.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<PsiMetaData>() {
|
||||
CachedValue<PsiMetaData> value = CachedValuesManager.getManager(element.getProject()).createCachedValue(new CachedValueProvider<PsiMetaData>() {
|
||||
public Result<PsiMetaData> compute() {
|
||||
data.init(element);
|
||||
return new Result<PsiMetaData>(data, data.getDependences());
|
||||
@@ -69,8 +69,7 @@ public class MetaRegistry extends MetaDataRegistrar {
|
||||
private static final UserDataCache<CachedValue<PsiMetaData>, PsiElement, Object> ourCachedMetaCache =
|
||||
new UserDataCache<CachedValue<PsiMetaData>, PsiElement, Object>() {
|
||||
protected CachedValue<PsiMetaData> compute(final PsiElement element, Object p) {
|
||||
return element.getManager().getCachedValuesManager()
|
||||
.createCachedValue(new CachedValueProvider<PsiMetaData>() {
|
||||
return CachedValuesManager.getManager(element.getProject()).createCachedValue(new CachedValueProvider<PsiMetaData>() {
|
||||
public Result<PsiMetaData> compute() {
|
||||
try {
|
||||
ensureContributorsLoaded();
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.JavaRefactoringActionHandlerFactory;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
@@ -212,7 +213,7 @@ public class PatternValidator extends LocalInspectionTool {
|
||||
return Result.create(p, (Object[])annotations);
|
||||
}
|
||||
};
|
||||
p = expression.getManager().getCachedValuesManager().createCachedValue(provider, false);
|
||||
p = CachedValuesManager.getManager(expression.getProject()).createCachedValue(provider, false);
|
||||
psiAnnotation.putUserData(COMPLIED_PATTERN, p);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.intellij.psi.scope.PsiScopeProcessor;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import com.intellij.unscramble.UnscrambleDialog;
|
||||
import com.intellij.util.containers.*;
|
||||
@@ -230,8 +231,7 @@ public class GroovyDslFileIndex extends ScalarIndexExtension<String> {
|
||||
PsiScopeProcessor processor,
|
||||
final GroovyFile dslFile) {
|
||||
final Project project = dslFile.getProject();
|
||||
final ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder> map = dslFile.getManager().getCachedValuesManager()
|
||||
.getCachedValue(dslFile, CACHED_ENHANCEMENTS, new CachedValueProvider<ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder>>() {
|
||||
final ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder> map = CachedValuesManager.getManager(dslFile.getProject()).getCachedValue(dslFile, CACHED_ENHANCEMENTS, new CachedValueProvider<ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder>>() {
|
||||
public Result<ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder>> compute() {
|
||||
final ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder> result =
|
||||
new ConcurrentFactoryMap<ClassDescriptor, CustomMembersHolder>() {
|
||||
|
||||
+2
-5
@@ -19,10 +19,7 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.infos.CandidateInfo;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
|
||||
@@ -79,7 +76,7 @@ public class CollectClassMembersUtil {
|
||||
}
|
||||
|
||||
private static CachedValue<Trinity<Map<String, CandidateInfo>, Map<String, List<CandidateInfo>>, Map<String, CandidateInfo>>> buildCache(final PsiClass aClass, final boolean includeSynthetic) {
|
||||
return aClass.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<Trinity<Map<String, CandidateInfo>, Map<String, List<CandidateInfo>>, Map<String, CandidateInfo>>>() {
|
||||
return CachedValuesManager.getManager(aClass.getProject()).createCachedValue(new CachedValueProvider<Trinity<Map<String, CandidateInfo>, Map<String, List<CandidateInfo>>, Map<String, CandidateInfo>>>() {
|
||||
public Result<Trinity<Map<String, CandidateInfo>, Map<String, List<CandidateInfo>>, Map<String, CandidateInfo>>> compute() {
|
||||
Map<String, CandidateInfo> allFields = new HashMap<String, CandidateInfo>();
|
||||
Map<String, List<CandidateInfo>> allMethods = new HashMap<String, List<CandidateInfo>>();
|
||||
|
||||
@@ -29,10 +29,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.PsiReferenceProcessor;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.intellij.psi.util.PropertyUtil;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.uiDesigner.UIFormXmlConstants;
|
||||
import com.intellij.uiDesigner.compiler.Utils;
|
||||
@@ -342,7 +339,7 @@ public class FormReferenceProvider extends PsiReferenceProvider {
|
||||
CachedValue<CachedFormData> data = element.getUserData(CACHED_DATA);
|
||||
|
||||
if(data == null) {
|
||||
data = element.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<CachedFormData>() {
|
||||
data = CachedValuesManager.getManager(element.getProject()).createCachedValue(new CachedValueProvider<CachedFormData>() {
|
||||
final Map<String, Pair<PsiType, TextRange>> map = new HashMap<String, Pair<PsiType, TextRange>>();
|
||||
public Result<CachedFormData> compute() {
|
||||
final PsiReferenceProcessor.CollectElements processor = new PsiReferenceProcessor.CollectElements() {
|
||||
|
||||
@@ -206,7 +206,7 @@ public class XsltSupport {
|
||||
}
|
||||
|
||||
public static XsltChecker.SupportLevel getXsltSupportLevel(PsiFile psiFile) {
|
||||
final CachedValuesManager mgr = psiFile.getManager().getCachedValuesManager();
|
||||
final CachedValuesManager mgr = CachedValuesManager.getManager(psiFile.getProject());
|
||||
return mgr.getParameterizedCachedValue(psiFile, FORCE_XSLT_KEY, XsltSupportProvider.INSTANCE, false, psiFile);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.SimpleFieldCache;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -228,7 +229,7 @@ public class XsltContextProvider extends ContextProvider {
|
||||
}
|
||||
|
||||
private CachedValue<ElementNames> createCachedValue(final PsiFile file) {
|
||||
return file.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<ElementNames>() {
|
||||
return CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<ElementNames>() {
|
||||
public Result<ElementNames> compute() {
|
||||
final ElementNames names = new ElementNames();
|
||||
final PsiFile[] associations = myFileAssociationsManager.getAssociationsFor(file, FileAssociationsManager.XML_FILES);
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.util.containers.ConcurrentFactoryMap;
|
||||
import com.intellij.util.containers.ConcurrentHashMap;
|
||||
@@ -106,7 +107,7 @@ public class EvaluatedXmlNameImpl implements EvaluatedXmlName {
|
||||
private List<String> getAllowedNamespaces(final XmlFile file) {
|
||||
CachedValue<FactoryMap<String, List<String>>> value = file.getUserData(NAMESPACE_PROVIDER_KEY);
|
||||
if (value == null) {
|
||||
file.putUserData(NAMESPACE_PROVIDER_KEY, value = file.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<FactoryMap<String, List<String>>>() {
|
||||
file.putUserData(NAMESPACE_PROVIDER_KEY, value = CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<FactoryMap<String, List<String>>>() {
|
||||
public Result<FactoryMap<String, List<String>>> compute() {
|
||||
final FactoryMap<String, List<String>> map = new ConcurrentFactoryMap<String, List<String>>() {
|
||||
protected List<String> create(final String key) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataCache;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -47,7 +48,7 @@ class FileDescriptionCachedValueProvider<T extends DomElement> implements SemEle
|
||||
private static final Key<CachedValue<XmlFileHeader>> ROOT_TAG_NS_KEY = Key.create("rootTag&ns");
|
||||
private static final UserDataCache<CachedValue<XmlFileHeader>,XmlFile,Object> ourRootTagCache = new UserDataCache<CachedValue<XmlFileHeader>, XmlFile, Object>() {
|
||||
protected CachedValue<XmlFileHeader> compute(final XmlFile file, final Object o) {
|
||||
return file.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<XmlFileHeader>() {
|
||||
return CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<XmlFileHeader>() {
|
||||
public Result<XmlFileHeader> compute() {
|
||||
return new Result<XmlFileHeader>(DomImplUtil.getXmlFileHeader(file), file);
|
||||
}
|
||||
|
||||
+2
-1
@@ -21,6 +21,7 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.FileViewProvider;
|
||||
import com.intellij.openapi.util.UserDataCache;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
|
||||
/**
|
||||
* @author Maxim.Mossienko
|
||||
@@ -29,7 +30,7 @@ import com.intellij.openapi.util.Key;
|
||||
*/
|
||||
public abstract class FileBasedUserDataCache<T> extends UserDataCache<CachedValue<T>, PsiFile, Object> {
|
||||
protected CachedValue<T> compute(final PsiFile xmlFile, final Object o) {
|
||||
return xmlFile.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<T>() {
|
||||
return CachedValuesManager.getManager(xmlFile.getProject()).createCachedValue(new CachedValueProvider<T>() {
|
||||
public Result<T> compute() {
|
||||
|
||||
return new Result<T>(doCompute(xmlFile), getDependencies(xmlFile));
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
@@ -70,8 +71,7 @@ public class XmlEntityRefImpl extends XmlElementImpl implements XmlEntityRef {
|
||||
final String name = decl.getName();
|
||||
if (cachingMap.containsKey(name)) return;
|
||||
cachingMap.put(
|
||||
name,
|
||||
file.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<XmlEntityDecl>() {
|
||||
name, CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<XmlEntityDecl>() {
|
||||
public Result<XmlEntityDecl> compute() {
|
||||
if (decl.isValid() && name.equals(decl.getName()))
|
||||
return new Result<XmlEntityDecl>(decl,decl);
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.intellij.psi.scope.processor.FilterElementProcessor;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -60,7 +61,7 @@ public class XmlElementDescriptorImpl extends BaseXmlElementDescriptorImpl imple
|
||||
|
||||
private static final UserDataCache<CachedValue<XmlAttlistDecl[]>,XmlElement, Object> myAttlistDeclCache = new UserDataCache<CachedValue<XmlAttlistDecl[]>,XmlElement, Object>() {
|
||||
protected final CachedValue<XmlAttlistDecl[]> compute(final XmlElement owner, Object o) {
|
||||
return owner.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<XmlAttlistDecl[]>() {
|
||||
return CachedValuesManager.getManager(owner.getProject()).createCachedValue(new CachedValueProvider<XmlAttlistDecl[]>() {
|
||||
public Result<XmlAttlistDecl[]> compute() {
|
||||
return new Result<XmlAttlistDecl[]>(doCollectAttlistDecls(owner),owner);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.intellij.psi.scope.processor.FilterElementProcessor;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
import com.intellij.xml.XmlNSDescriptor;
|
||||
@@ -100,7 +101,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptor,Validator<XmlDocumen
|
||||
|
||||
// Read-only calculation
|
||||
private CachedValue<Map<String, XmlElementDescriptor>> doBuildDeclarationMap() {
|
||||
return myElement.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<Map<String, XmlElementDescriptor>>() {
|
||||
return CachedValuesManager.getManager(myElement.getProject()).createCachedValue(new CachedValueProvider<Map<String, XmlElementDescriptor>>() {
|
||||
public Result<Map<String, XmlElementDescriptor>> compute() {
|
||||
final List<XmlElementDecl> result = new ArrayList<XmlElementDecl>();
|
||||
myElement.processElements(new FilterElementProcessor(new ClassFilter(XmlElementDecl.class), result), getDeclaration());
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.intellij.psi.meta.PsiMetaData;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlDocument;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
@@ -174,8 +175,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptor,Validator<XmlDocumen
|
||||
|
||||
if (name != null) {
|
||||
if (checkElementNameEquivalence(localName, namespace, name, tag)) {
|
||||
final CachedValue<XmlElementDescriptor> cachedValue =
|
||||
tag.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<XmlElementDescriptor>() {
|
||||
final CachedValue<XmlElementDescriptor> cachedValue = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<XmlElementDescriptor>() {
|
||||
public Result<XmlElementDescriptor> compute() {
|
||||
final String name = tag.getAttributeValue("name");
|
||||
|
||||
@@ -311,7 +311,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptor,Validator<XmlDocumen
|
||||
final XmlAttributeDescriptor attributeDescriptor = ((XmlNSDescriptorImpl)data).getAttributeImpl(localName, namespace,visited);
|
||||
|
||||
if(attributeDescriptor != null){
|
||||
final CachedValue<XmlAttributeDescriptor> value = includedDocument.getManager().getCachedValuesManager().createCachedValue(
|
||||
final CachedValue<XmlAttributeDescriptor> value = CachedValuesManager.getManager(includedDocument.getProject()).createCachedValue(
|
||||
new CachedValueProvider<XmlAttributeDescriptor>(){
|
||||
public Result<XmlAttributeDescriptor> compute() {
|
||||
return new Result<XmlAttributeDescriptor>(attributeDescriptor, attributeDescriptor.getDependences());
|
||||
@@ -509,8 +509,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptor,Validator<XmlDocumen
|
||||
if (document != null) {
|
||||
final Set<XmlTag> visited1 = visited;
|
||||
|
||||
final CachedValue<TypeDescriptor> value =
|
||||
tag.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<TypeDescriptor>() {
|
||||
final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<TypeDescriptor>() {
|
||||
public Result<TypeDescriptor> compute() {
|
||||
final String currentName = tag.getAttributeValue("name");
|
||||
|
||||
@@ -584,7 +583,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptor,Validator<XmlDocumen
|
||||
}
|
||||
|
||||
private CachedValue<TypeDescriptor> createAndPutTypesCachedValueSimpleType(final XmlTag tag, final Pair<QNameKey, XmlTag> pair) {
|
||||
final CachedValue<TypeDescriptor> value = tag.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<TypeDescriptor>() {
|
||||
final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<TypeDescriptor>() {
|
||||
public CachedValueProvider.Result<TypeDescriptor> compute() {
|
||||
final SimpleTypeDescriptor simpleTypeDescriptor = new SimpleTypeDescriptor(tag);
|
||||
return new Result<TypeDescriptor>(simpleTypeDescriptor, tag);
|
||||
@@ -595,7 +594,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptor,Validator<XmlDocumen
|
||||
}
|
||||
|
||||
private CachedValue<TypeDescriptor> createAndPutTypesCachedValue(final XmlTag tag, final Pair<QNameKey, XmlTag> pair) {
|
||||
final CachedValue<TypeDescriptor> value = tag.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<TypeDescriptor>() {
|
||||
final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(new CachedValueProvider<TypeDescriptor>() {
|
||||
public CachedValueProvider.Result<TypeDescriptor> compute() {
|
||||
final String name = tag.getAttributeValue("name");
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.psi.impl.source.resolve.reference.impl.providers.IdReference
|
||||
import com.intellij.psi.templateLanguages.OuterLanguageElement;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.xml.XmlAttributeDescriptor;
|
||||
@@ -43,7 +44,7 @@ public class XmlRefCountHolder {
|
||||
private final static UserDataCache<CachedValue<XmlRefCountHolder>, XmlFile, Object> CACHE =
|
||||
new UserDataCache<CachedValue<XmlRefCountHolder>, XmlFile, Object>() {
|
||||
protected CachedValue<XmlRefCountHolder> compute(final XmlFile file, final Object p) {
|
||||
return file.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<XmlRefCountHolder>() {
|
||||
return CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider<XmlRefCountHolder>() {
|
||||
public Result<XmlRefCountHolder> compute() {
|
||||
final XmlRefCountHolder holder = new XmlRefCountHolder();
|
||||
final Language language = file.getViewProvider().getBaseLanguage();
|
||||
|
||||
@@ -51,10 +51,7 @@ import com.intellij.psi.impl.source.xml.XmlEntityRefImpl;
|
||||
import com.intellij.psi.scope.processor.FilterElementProcessor;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.util.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -598,8 +595,7 @@ public class XmlUtil {
|
||||
|
||||
private boolean processXInclude(final boolean deepFlag, final boolean wideFlag, final XmlTag xincludeTag) {
|
||||
|
||||
final PsiElement[] inclusion = xincludeTag.getManager().getCachedValuesManager()
|
||||
.getCachedValue(xincludeTag, KEY_RESOLVED_XINCLUDE, new CachedValueProvider<PsiElement[]>() {
|
||||
final PsiElement[] inclusion = CachedValuesManager.getManager(xincludeTag.getProject()).getCachedValue(xincludeTag, KEY_RESOLVED_XINCLUDE, new CachedValueProvider<PsiElement[]>() {
|
||||
public Result<PsiElement[]> compute() {
|
||||
final Result<PsiElement[]> result = computeInclusion(xincludeTag);
|
||||
result.setLockValue(true);
|
||||
@@ -776,7 +772,7 @@ public class XmlUtil {
|
||||
// return entityDecl.parse(targetFile, type);
|
||||
|
||||
if (value == null) {
|
||||
value = entityDecl.getManager().getCachedValuesManager().createCachedValue(new CachedValueProvider<PsiElement>() {
|
||||
value = CachedValuesManager.getManager(entityDecl.getProject()).createCachedValue(new CachedValueProvider<PsiElement>() {
|
||||
public Result<PsiElement> compute() {
|
||||
final PsiElement res = entityDecl.parse(targetFile, type, entityRef);
|
||||
if (res == null) return new Result<PsiElement>(res, targetFile);
|
||||
|
||||
Reference in New Issue
Block a user