Compare anonymous classes with psi only to avoid counting qualified name
This commit is contained in:
+16
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.asJava
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.impl.InheritanceImplUtil
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.reference.SoftReference
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
@@ -88,6 +89,21 @@ internal open class KtLightClassForAnonymousDeclaration(name: FqName,
|
||||
return false
|
||||
}
|
||||
|
||||
override fun getName(): String? = null
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (other == null || javaClass != other.javaClass) return false
|
||||
|
||||
val aClass = other as KtLightClassForAnonymousDeclaration
|
||||
|
||||
return classOrObject == aClass.classOrObject
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return classOrObject.hashCode()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val LOG = Logger.getInstance(KtLightClassForAnonymousDeclaration::class.java)
|
||||
}
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ open class KtLightClassForExplicitDeclaration(
|
||||
|
||||
override fun getTypeParameters(): Array<PsiTypeParameter> = _typeParameterList.typeParameters
|
||||
|
||||
override fun getName(): String = classFqName.shortName().asString()
|
||||
override fun getName(): String? = classFqName.shortName().asString()
|
||||
|
||||
override fun getQualifiedName(): String = classFqName.asString()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user