XmlFileHeader (@NotNull XmlFile file) { if (FileBasedIndex.getInstance().getFileBeingCurrentlyIndexed() != null) { return calcXmlFileHeader(file); } return CachedValuesManager.getCachedValue(file, () -> new CachedValueProvider.Result<>(calcXmlFileHeader(file), file)); }