Compare anonymous classes with psi only to avoid counting qualified name

This commit is contained in:
Nikolay Krasko
2016-06-08 14:20:09 +03:00
parent de986ed051
commit 9359d0aab4
2 changed files with 17 additions and 1 deletions
@@ -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)
}
@@ -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()