Improved equals for light decompiled declarations
This commit is contained in:
+1
-1
@@ -219,7 +219,7 @@ open class KtLightClassForDecompiledDeclaration(
|
||||
qualifiedName == other.qualifiedName &&
|
||||
kotlinOrigin?.fqName == other.kotlinOrigin?.fqName
|
||||
|
||||
override fun hashCode(): Int = clsDelegate.hashCode()
|
||||
override fun hashCode(): Int = qualifiedName?.hashCode() ?: kotlinOrigin?.fqName?.hashCode() ?: 0
|
||||
|
||||
override fun copy(): PsiElement = this
|
||||
|
||||
|
||||
+5
-2
@@ -57,9 +57,12 @@ open class KtLightFieldForDecompiledDeclaration(
|
||||
|
||||
override fun computeConstantValue(visitedVars: MutableSet<PsiVariable>?): Any? = (fldDelegate as? PsiVariableEx)?.computeConstantValue(visitedVars)
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is KtLightFieldForDecompiledDeclaration && fldParent == other.fldParent && fldDelegate == other.fldDelegate
|
||||
override fun equals(other: Any?): Boolean = other is KtLightFieldForDecompiledDeclaration &&
|
||||
name == other.name &&
|
||||
fldParent == other.fldParent &&
|
||||
fldDelegate == other.fldDelegate
|
||||
|
||||
override fun hashCode(): Int = fldDelegate.hashCode()
|
||||
override fun hashCode(): Int = name.hashCode()
|
||||
|
||||
override fun copy(): PsiElement = this
|
||||
|
||||
|
||||
+5
-4
@@ -15,8 +15,6 @@ import org.jetbrains.kotlin.asJava.classes.KtLightClass
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightElementBase
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightMember
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightMethod
|
||||
import org.jetbrains.kotlin.asJava.propertyNameByAccessor
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||
import org.jetbrains.kotlin.idea.caches.lightClasses.LightMemberOriginForCompiledMethod
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
|
||||
@@ -88,9 +86,12 @@ class KtLightMethodForDecompiledDeclaration(
|
||||
override fun getSignature(substitutor: PsiSubstitutor): MethodSignature =
|
||||
MethodSignatureBackedByPsiMethod.create(this, substitutor)
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is KtLightMethodForDecompiledDeclaration && funParent == other.funParent && funDelegate == other.funDelegate
|
||||
override fun equals(other: Any?): Boolean = other is KtLightMethodForDecompiledDeclaration &&
|
||||
name == other.name &&
|
||||
funParent == other.funParent &&
|
||||
funDelegate == other.funDelegate
|
||||
|
||||
override fun hashCode(): Int = funDelegate.hashCode()
|
||||
override fun hashCode(): Int = name.hashCode()
|
||||
|
||||
override fun copy(): PsiElement = this
|
||||
|
||||
|
||||
Reference in New Issue
Block a user