CachedValue<TypeDescriptor> (final XmlTag tag, final Pair<QNameKey, XmlTag> pair) { final CachedValue<TypeDescriptor> value = CachedValuesManager.getManager(tag.getProject()).createCachedValue( () -> { final String name = tag.getAttributeValue("name"); if (name != null && pair.first != null && pair.first.first != null && !name.equals(XmlUtil.findLocalNameByQualifiedName(pair.first.first)) ) { myTypesMap.remove(pair); return new CachedValueProvider.Result<>(null, PsiModificationTracker.MODIFICATION_COUNT); } final ComplexTypeDescriptor complexTypeDescriptor = new ComplexTypeDescriptor(this, tag); return new CachedValueProvider.Result<>(complexTypeDescriptor, tag); }, false); myTypesMap.put(pair, value); return value; }