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

Parsing java has failures in hashing #1599

Closed
asfalcone opened this issue Oct 29, 2020 · 6 comments · Fixed by #1715 or #3143
Closed

Parsing java has failures in hashing #1599

asfalcone opened this issue Oct 29, 2020 · 6 comments · Fixed by #1715 or #3143
Labels
bug feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs

Comments

@asfalcone
Copy link
Contributor

Describe the bug
Parsing java has failures in hashing

To Reproduce
https://cs.android.com/androidx/platform/tools/dokka-devsite-plugin/+/master:testData/fragment/source/ Using the source of the Android Jetpack Fragment library we often (but not always) see two kinds of errors in hashing from findVirtualFileForTopLevelClass

Stacktrace 1

Index 88 out of bounds for length 79
java.lang.ArrayIndexOutOfBoundsException: Index 88 out of bounds for length 79
	at gnu.trove.THashMap.rehash(THashMap.java:350)
	at gnu.trove.THash.postInsertHook(THash.java:286)
	at gnu.trove.THashMap.put(THashMap.java:174)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:306)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:70)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:69)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:135)
	at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:44)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:110)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:87)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.tryClassResult(PsiJavaCodeReferenceElementImpl.java:416)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:397)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:375)
	at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:200)
	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:199)
	at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:797)
	at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:788)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.multiResolve(PsiJavaCodeReferenceElementImpl.java:434)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.advancedResolve(PsiJavaCodeReferenceElementImpl.java:427)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:179)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:124)
	at com.intellij.psi.util.TypeConversionUtil$2.visitClassType(TypeConversionUtil.java:1267)
	at com.intellij.psi.util.TypeConversionUtil$2.visitClassType(TypeConversionUtil.java:1258)
	at com.intellij.psi.PsiClassType.accept(PsiClassType.java:239)
	at com.intellij.psi.util.TypeConversionUtil.erasure(TypeConversionUtil.java:1258)
	at com.intellij.psi.util.MethodSignatureUtil.calcErasedParameterTypes(MethodSignatureUtil.java:91)
	at com.intellij.psi.util.MethodSignatureBase.getErasedParameterTypes(MethodSignatureBase.java:80)
	at com.intellij.psi.util.MethodSignatureBase.hashCode(MethodSignatureBase.java:95)
	at com.intellij.psi.util.MethodSignatureUtil$2.computeHashCode(MethodSignatureUtil.java:52)
	at com.intellij.psi.util.MethodSignatureUtil$2.computeHashCode(MethodSignatureUtil.java:49)
	at gnu.trove.TObjectHash.insertionIndex(TObjectHash.java:224)
	at gnu.trove.THashMap.put(THashMap.java:164)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.buildMethodHierarchy(PsiSuperMethodImplUtil.java:187)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.lambda$null$1(PsiSuperMethodImplUtil.java:36)
	at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:176)
	at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:40)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.lambda$null$3(PsiSuperMethodImplUtil.java:370)
	at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:176)
	at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:40)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.getHierarchicalMethodSignature(PsiSuperMethodImplUtil.java:379)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.getHierarchicalMethodSignature(PsiSuperMethodImplUtil.java:359)
	at com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef.findMethods(PsiDocMethodOrFieldRef.java:211)
	at com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef.getReferenceInScope(PsiDocMethodOrFieldRef.java:105)
	at com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef.getReference(PsiDocMethodOrFieldRef.java:59)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.toDocumentationLinkString(JavadocParser.kt:169)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.convertInlineDocTag(JavadocParser.kt:180)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.stringify(JavadocParser.kt:153)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.invoke(JavadocParser.kt:231)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.convertJavadocElements(JavadocParser.kt:250)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.convertJavadocElements$default(JavadocParser.kt:249)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.getDescription(JavadocParser.kt:143)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.parseDocumentation(JavadocParser.kt:35)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parseClasslike$2.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:192)
	(Coroutine boundary)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parsePackage$2$invokeSuspend$$inlined$parallelMap$1$1.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:19)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parsePackage$2.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:575)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$invoke$2$invokeSuspend$$inlined$parallelMap$2$1.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:19)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$invoke$2.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:618)
	at org.jetbrains.dokka.DokkaGenerator$translateSources$$inlined$parallelMap$1$1.invokeSuspend(DokkaGenerator.kt:19)
	at org.jetbrains.dokka.DokkaGenerator$createDocumentationModels$1$invokeSuspend$$inlined$parallelMap$1$1.invokeSuspend(DokkaGenerator.kt:19)
	at org.jetbrains.dokka.DokkaGenerator$createDocumentationModels$1.invokeSuspend(DokkaGenerator.kt:194)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 88 out of bounds for length 79
	at gnu.trove.THashMap.rehash(THashMap.java:350)
	at gnu.trove.THash.postInsertHook(THash.java:286)
	at gnu.trove.THashMap.put(THashMap.java:174)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:306)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:70)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:69)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:135)
	at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:44)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:110)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:87)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.tryClassResult(PsiJavaCodeReferenceElementImpl.java:416)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:397)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:375)
	at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:200)
	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:199)
	at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:797)
	at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:788)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.multiResolve(PsiJavaCodeReferenceElementImpl.java:434)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.advancedResolve(PsiJavaCodeReferenceElementImpl.java:427)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:179)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:124)
	at com.intellij.psi.util.TypeConversionUtil$2.visitClassType(TypeConversionUtil.java:1267)
	at com.intellij.psi.util.TypeConversionUtil$2.visitClassType(TypeConversionUtil.java:1258)
	at com.intellij.psi.PsiClassType.accept(PsiClassType.java:239)
	at com.intellij.psi.util.TypeConversionUtil.erasure(TypeConversionUtil.java:1258)
	at com.intellij.psi.util.MethodSignatureUtil.calcErasedParameterTypes(MethodSignatureUtil.java:91)
	at com.intellij.psi.util.MethodSignatureBase.getErasedParameterTypes(MethodSignatureBase.java:80)
	at com.intellij.psi.util.MethodSignatureBase.hashCode(MethodSignatureBase.java:95)
	at com.intellij.psi.util.MethodSignatureUtil$2.computeHashCode(MethodSignatureUtil.java:52)
	at com.intellij.psi.util.MethodSignatureUtil$2.computeHashCode(MethodSignatureUtil.java:49)
	at gnu.trove.TObjectHash.insertionIndex(TObjectHash.java:224)
	at gnu.trove.THashMap.put(THashMap.java:164)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.buildMethodHierarchy(PsiSuperMethodImplUtil.java:187)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.lambda$null$1(PsiSuperMethodImplUtil.java:36)
	at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:176)
	at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:40)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.lambda$null$3(PsiSuperMethodImplUtil.java:370)
	at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:176)
	at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:40)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.getHierarchicalMethodSignature(PsiSuperMethodImplUtil.java:379)
	at com.intellij.psi.impl.PsiSuperMethodImplUtil.getHierarchicalMethodSignature(PsiSuperMethodImplUtil.java:359)
	at com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef.findMethods(PsiDocMethodOrFieldRef.java:211)
	at com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef.getReferenceInScope(PsiDocMethodOrFieldRef.java:105)
	at com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef.getReference(PsiDocMethodOrFieldRef.java:59)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.toDocumentationLinkString(JavadocParser.kt:169)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.convertInlineDocTag(JavadocParser.kt:180)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.stringify(JavadocParser.kt:153)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser$Parse.invoke(JavadocParser.kt:231)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.convertJavadocElements(JavadocParser.kt:250)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.convertJavadocElements$default(JavadocParser.kt:249)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.getDescription(JavadocParser.kt:143)
	at org.jetbrains.dokka.base.translators.psi.JavadocParser.parseDocumentation(JavadocParser.kt:35)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parseClasslike$2.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:192)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Stacktrace 2

java.lang.IllegalArgumentException: Equal objects must have equal hashcodes. During rehashing, Trove discovered that the following two objects claim to be equal (as in java.lang.Object.equals() or TObjectHashingStrategy.equals()) but their hashCodes (or those calculated by your TObjectHashingStrategy) are not equal.This violates the general contract of java.lang.Object.hashCode().  See bullet point two in that method's documentation. object #1 =android (class org.jetbrains.kotlin.name.FqName), hashCode=-861391249; object #2 =android (class org.jetbrains.kotlin.name.FqName), hashCode=-861391249
	at gnu.trove.TObjectHash.throwObjectContractViolation(TObjectHash.java:331)
	at gnu.trove.THashMap.rehash(THashMap.java:347)
	at gnu.trove.THash.postInsertHook(THash.java:286)
	at gnu.trove.THashMap.put(THashMap.java:174)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:306)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:70)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:69)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:135)
	at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:44)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:110)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:87)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.tryClassResult(PsiJavaCodeReferenceElementImpl.java:416)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:397)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:375)
	at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:200)
	at com.intellij.psi.impl.source.resolve.ResolveCache$$Lambda$185/214444723.compute(Unknown Source)
	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:199)
	at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:797)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.getCanonicalText(PsiJavaCodeReferenceElementImpl.java:297)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.getCanonicalText(PsiJavaCodeReferenceElementImpl.java:287)
	at com.intellij.psi.impl.source.PsiClassReferenceType.getText(PsiClassReferenceType.java:245)
	at com.intellij.psi.impl.source.PsiClassReferenceType.getCanonicalText(PsiClassReferenceType.java:231)
	at com.intellij.psi.PsiClassType$Stub.getCanonicalText(PsiClassType.java:358)
	at org.jetbrains.dokka.analysis.CallableFactoryKt.from(CallableFactory.kt:22)
	at org.jetbrains.dokka.analysis.DRIFactoryKt.from(DRIFactory.kt:33)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser.parseFunction(DefaultPsiToDocumentableTranslator.kt:333)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser.parseFunction$default(DefaultPsiToDocumentableTranslator.kt:331)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parseClasslike$2$invokeSuspend$$inlined$with$lambda$3$1$1.invokeSuspend(parallelCollectionOperations.kt:19)
	at ???(Coroutine boundary.?(?)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parsePackage$2$invokeSuspend$$inlined$parallelMap$1$1.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:19)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parsePackage$2.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:575)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$invoke$2$invokeSuspend$$inlined$parallelMap$2$1.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:19)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$invoke$2.invokeSuspend(DefaultPsiToDocumentableTranslator.kt:618)
	at org.jetbrains.dokka.DokkaGenerator$translateSources$$inlined$parallelMap$1$1.invokeSuspend(DokkaGenerator.kt:19)
	at org.jetbrains.dokka.DokkaGenerator$createDocumentationModels$1$invokeSuspend$$inlined$parallelMap$1$1.invokeSuspend(DokkaGenerator.kt:19)
	at org.jetbrains.dokka.DokkaGenerator$createDocumentationModels$1.invokeSuspend(DokkaGenerator.kt:194)
Caused by: java.lang.IllegalArgumentException: Equal objects must have equal hashcodes. During rehashing, Trove discovered that the following two objects claim to be equal (as in java.lang.Object.equals() or TObjectHashingStrategy.equals()) but their hashCodes (or those calculated by your TObjectHashingStrategy) are not equal.This violates the general contract of java.lang.Object.hashCode().  See bullet point two in that method's documentation. object #1 =android (class org.jetbrains.kotlin.name.FqName), hashCode=-861391249; object #2 =android (class org.jetbrains.kotlin.name.FqName), hashCode=-861391249
	at gnu.trove.TObjectHash.throwObjectContractViolation(TObjectHash.java:331)
	at gnu.trove.THashMap.rehash(THashMap.java:347)
	at gnu.trove.THash.postInsertHook(THash.java:286)
	at gnu.trove.THashMap.put(THashMap.java:174)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:306)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:70)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:48)
	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:69)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:135)
	at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:44)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:110)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:87)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.tryClassResult(PsiJavaCodeReferenceElementImpl.java:416)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:397)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:375)
	at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:200)
	at com.intellij.psi.impl.source.resolve.ResolveCache$$Lambda$185/214444723.compute(Unknown Source)
	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:199)
	at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:797)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.getCanonicalText(PsiJavaCodeReferenceElementImpl.java:297)
	at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.getCanonicalText(PsiJavaCodeReferenceElementImpl.java:287)
	at com.intellij.psi.impl.source.PsiClassReferenceType.getText(PsiClassReferenceType.java:245)
	at com.intellij.psi.impl.source.PsiClassReferenceType.getCanonicalText(PsiClassReferenceType.java:231)
	at com.intellij.psi.PsiClassType$Stub.getCanonicalText(PsiClassType.java:358)
	at org.jetbrains.dokka.analysis.CallableFactoryKt.from(CallableFactory.kt:22)
	at org.jetbrains.dokka.analysis.DRIFactoryKt.from(DRIFactory.kt:33)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser.parseFunction(DefaultPsiToDocumentableTranslator.kt:333)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser.parseFunction$default(DefaultPsiToDocumentableTranslator.kt:331)
	at org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator$DokkaPsiParser$parseClasslike$2$invokeSuspend$$inlined$with$lambda$3$1$1.invokeSuspend(parallelCollectionOperations.kt:19)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Installation

  • Operating system: macOS/Windows/Linux
  • Build tool: CLI
  • Dokka version: 1.4.10.2-dev-19
@asfalcone asfalcone added the bug label Oct 29, 2020
@MarcinAman MarcinAman added the feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs label Oct 29, 2020
@harri35
Copy link

harri35 commented Nov 4, 2020

Getting the same issue.
Android project, Dokka 1.4.10.2
Just added in Dokka as a replacement to the Javadoc as I need to start adding Kotlin code.

Randomly getting:

> Equal objects must have equal hashcodes. During rehashing, Trove discovered that the following two objects claim to be equal (as in java.lang.Object.equals() or TObjectHashingStrategy.equals()) but their hashCodes (or those calculated by your TObjectHashingStrategy) are not equal.This violates the general contract of java.lang.Object.hashCode(). See bullet point two in that method's documentation. object #1 =ee.myapp.inter.ErrorContextAccess (class org.jetbrains.kotlin.name.FqName), hashCode=-635979958; object #2 =ee.myapp.inter.ErrorContextAccess (class org.jetbrains.kotlin.name.FqName), hashCode=-635979958

@harri35
Copy link

harri35 commented Dec 9, 2020

Any news on this? Getting it quite frequently

Equal objects must have equal hashcodes. During rehashing, Trove discovered that the following two objects claim to be equal (as in java.lang.Object.equals() or TObjectHashingStrategy.equals()) but their hashCodes (or those calculated by your TObjectHashingStrategy) are not equal.This violates the general contract of java.lang.Object.hashCode(). See bullet point two in that method's documentation. object #1 =org.junit (class org.jetbrains.kotlin.name.FqName), hashCode=689927524; object #2 =org.junit (class org.jetbrains.kotlin.name.FqName), hashCode=689927524

@MarcinAman
Copy link
Contributor

i will try do work on it or at least get some help from the compiler team

@harri35 could you post your project so i can have a little more data about the issue?

@harri35
Copy link

harri35 commented Dec 10, 2020

@MarcinAman Sorry, the project source code is proprietary and I can't post it. If there are any files / logs from the build process then maybe I can provide these.
A few things from the project:
It is 95% Java, 5% Kotlin. Just started moving to Kotlin. That is why the need for Dokka also.
The project itself is a library that has a dependency library which it is wrapping and which has a lot of similar classes. As there is a rule that we can't provide the UI the classes directly from our internal library. Maybe the existence of the similar classes is an issue there.

@gnarea
Copy link

gnarea commented Jan 7, 2021

I've experienced this a couple of times today since upgrading from 0.10 to v1. Here's the project: https://github.com/relaycorp/relaynet-cogrpc-jvm

@MarcinAman MarcinAman linked a pull request Feb 1, 2021 that will close this issue
@DanySK
Copy link

DanySK commented Feb 1, 2021

The bug seems to appear randomly and it is hard to reproduce. Here is a run where it failed:
https://github.com/AlchemistSimulator/Alchemist/runs/1800103044?check_suite_focus=true

Here is the corresponding Gradle build scan: https://scans.gradle.com/s/6pyir6cwg3nts

Other runs on the same code base worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants