diff --git a/platform/core-api/src/com/intellij/psi/util/CachedValue.java b/platform/core-api/src/com/intellij/psi/util/CachedValue.java index 5e20a88c892d..4972cea4a0f4 100644 --- a/platform/core-api/src/com/intellij/psi/util/CachedValue.java +++ b/platform/core-api/src/com/intellij/psi/util/CachedValue.java @@ -15,8 +15,8 @@ */ package com.intellij.psi.util; -import com.intellij.openapi.util.RecursionGuard; import com.intellij.openapi.util.Getter; +import com.intellij.openapi.util.RecursionGuard; import org.jetbrains.annotations.NotNull; /** @@ -37,7 +37,18 @@ import org.jetbrains.annotations.NotNull; * be run concurrently on more than one thread. Due to this and unpredictable garbage collection, * cached value providers shouldn't have side effects.
* - * Important note: if you store the CachedValue in a field or user data of some object {@code X}, then its {@link CachedValueProvider} + * Result equivalence: CachedValue might return a different result even if the previous one + * is still reachable and not garbage-collected, and dependencies haven't changed. Therefore CachedValue results + * should be equivalent and interchangeable if they're called multiple times. Examples: + *