Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: don't call JavaResolveCache#getType with different functions on the same PSI #64

Open
donnerpeter opened this issue Sep 29, 2020 · 0 comments

Comments

@donnerpeter
Copy link

java.lang.Throwable: Incorrect CachedValue use: same CV with different captured context, this can cause unstable results and invalid PSI access.
Field arg$1 in class com.intellij.psi.impl.source.resolve.JavaResolveCache$$Lambda$5085/0x0000000802e1c840 has non-equivalent values:
com.intellij.psi.impl.source.tree.java.PsiBinaryExpressionImpl$$Lambda$1871/0x00000008018af040@19054d9f (com.intellij.psi.impl.source.tree.java.PsiBinaryExpressionImpl$$Lambda$1871/0x00000008018af040) and
javaoo.idea.PsiOOBinaryExpressionImpl$1@5bdeb262 (javaoo.idea.PsiOOBinaryExpressionImpl$1)
Either make equals() hold for these values, or avoid this dependency, e.g. by extracting CV provider into a static method.
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:143)
at com.intellij.util.CachedValueStabilityChecker.complain(CachedValueStabilityChecker.java:163)
at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:130)
at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:126)
at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:126)
at com.intellij.util.CachedValueStabilityChecker.checkProvidersEquivalent(CachedValueStabilityChecker.java:81)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:71)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150)
at com.intellij.psi.util.CachedValuesManager.getProjectPsiDependentCache(CachedValuesManager.java:131)
at com.intellij.psi.impl.source.resolve.JavaResolveCache.getType(JavaResolveCache.java:65)
at com.intellij.psi.impl.source.tree.java.PsiBinaryExpressionImpl.getType(PsiBinaryExpressionImpl.java:89)
at javaoo.idea.PsiOOBinaryExpressionImpl.access$001(PsiOOBinaryExpressionImpl.java:24)
at javaoo.idea.PsiOOBinaryExpressionImpl$1.fun(PsiOOBinaryExpressionImpl.java:31)
at javaoo.idea.PsiOOBinaryExpressionImpl$1.fun(PsiOOBinaryExpressionImpl.java:27)
at com.intellij.psi.impl.source.resolve.JavaResolveCache.lambda$getType$0(JavaResolveCache.java:65)
at com.intellij.psi.util.CachedValuesManager.lambda$getProjectPsiDependentCache$0(CachedValuesManager.java:132)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:153)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:76)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150)
at com.intellij.psi.util.CachedValuesManager.getProjectPsiDependentCache(CachedValuesManager.java:131)
at com.intellij.psi.impl.source.resolve.JavaResolveCache.getType(JavaResolveCache.java:65)
at javaoo.idea.PsiOOBinaryExpressionImpl.getType(PsiOOBinaryExpressionImpl.java:27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant