[light classes] KtLightClassForSourceDeclaration: update equals and hashCode to fix PluginException

^KTIJ-19042 Fixed
^EA-357501 Fixed
This commit is contained in:
Dmitry Gridin
2021-09-13 15:25:58 +07:00
committed by Space
parent 23a02be169
commit 72752473bf
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -169,11 +169,12 @@ abstract class KtLightClassForSourceDeclaration(
val aClass = other as KtLightClassForSourceDeclaration
if (classOrObject != aClass.classOrObject) return false
if (jvmDefaultMode != aClass.jvmDefaultMode) return false
return true
}
override fun hashCode(): Int = classOrObject.hashCode()
override fun hashCode(): Int = classOrObject.hashCode() * 31 + jvmDefaultMode.hashCode()
override fun getContainingClass(): PsiClass? {
if (classOrObject.parent === classOrObject.containingFile) return null