From 7a677e8dff592d2252e286ea07afcd53d9e99f57 Mon Sep 17 00:00:00 2001 From: Ruslan Cheremin Date: Wed, 12 Nov 2025 20:04:15 +0100 Subject: [PATCH] [indexes] IJPL-175210: comments & docs GitOrigin-RevId: 2db885ccff578c197cb8206676d1bfdc75af488c --- .../impl/perFileVersion/AutoRefreshingOnVfsCloseRef.kt | 2 +- .../util/indexing/impl/perFileVersion/IntFileAttribute.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/AutoRefreshingOnVfsCloseRef.kt b/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/AutoRefreshingOnVfsCloseRef.kt index 90786e1a8535..6a7b4d30f9d2 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/AutoRefreshingOnVfsCloseRef.kt +++ b/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/AutoRefreshingOnVfsCloseRef.kt @@ -42,7 +42,7 @@ class AutoRefreshingOnVfsCloseRef(private val factory: (FSRecords attributeAccessor?.close() } finally { - attributeAccessor = null + attributeAccessor = null //will be re-opened on next invoke() call } } diff --git a/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/IntFileAttribute.kt b/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/IntFileAttribute.kt index 28b24fd7b098..8c4be42d2f88 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/IntFileAttribute.kt +++ b/platform/lang-impl/src/com/intellij/util/indexing/impl/perFileVersion/IntFileAttribute.kt @@ -15,7 +15,8 @@ import java.nio.file.Path /** * This is a simple wrapper around [SpecializedFileAttributes], either fast or a regular one. * The main function of this wrapper is to make the attribute auto-reopenable, with help of [AutoRefreshingOnVfsCloseRef]: - * which means that the storage will be automatically reset if VFS is rebuilt, and also automatically reopened, if [close]-ed + * which means that the storage will be automatically reset if VFS is rebuilt, and also automatically reopened, if + * used after [close]-ed * * @see AutoRefreshingOnVfsCloseRef */ @@ -27,6 +28,7 @@ sealed interface IntFileAttribute : Closeable, Unmappable { return true } + /** One should create a single instance per id -- an attempt to create >1 instance for the same id leads to an exception */ @JvmStatic fun create(id: String, version: Int): IntFileAttribute { val fast = shouldUseFastAttributes()