amelentev / java-oo

Java Operator Overloading
http://amelentev.github.io/java-oo/
268 stars 31 forks source link

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

Open donnerpeter opened 4 years ago

donnerpeter commented 4 years ago

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)