Drop KtLightClass#getFqName() and some usages of classFqName in KtLightClassForDecompiledDeclaration
This commit is contained in:
-8
@@ -26,7 +26,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.asJava.KtJavaMirrorMarker;
|
||||
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder;
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject;
|
||||
import org.jetbrains.kotlin.psi.KtFile;
|
||||
|
||||
@@ -71,13 +70,6 @@ public class FakeLightClassForFileOfPackage extends AbstractLightClass implement
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FqName getFqName() {
|
||||
return delegate.getFqName();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiClass getDelegate() {
|
||||
|
||||
@@ -21,6 +21,4 @@ import org.jetbrains.kotlin.asJava.elements.KtLightDeclaration
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
|
||||
interface KtLightClass : PsiClass, KtLightDeclaration<KtClassOrObject, PsiClass> {
|
||||
fun getFqName(): FqName
|
||||
}
|
||||
interface KtLightClass : PsiClass, KtLightDeclaration<KtClassOrObject, PsiClass>
|
||||
|
||||
+2
-1
@@ -106,7 +106,8 @@ class KtLightClassForFacade private constructor(
|
||||
|
||||
override val kotlinOrigin: KtClassOrObject? get() = null
|
||||
|
||||
override fun getFqName(): FqName = facadeClassFqName
|
||||
val fqName: FqName
|
||||
get() = facadeClassFqName
|
||||
|
||||
override fun getModifierList() = modifierList
|
||||
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ class KtLightClassForInterfaceDefaultImpls(
|
||||
: KtLightClassForSourceDeclaration({ classFqName }, classOrObject){
|
||||
override fun getQualifiedName(): String = classFqName.asString()
|
||||
|
||||
override fun getName() = JvmAbi.DEFAULT_IMPLS_CLASS_NAME
|
||||
override fun getParent() = containingClass
|
||||
|
||||
override fun copy(): PsiElement {
|
||||
|
||||
+3
-5
@@ -74,8 +74,6 @@ abstract class KtLightClassForSourceDeclaration(
|
||||
|
||||
override val kotlinOrigin: KtClassOrObject = classOrObject
|
||||
|
||||
override fun getFqName(): FqName = classFqName
|
||||
|
||||
abstract override fun copy(): PsiElement
|
||||
abstract override fun getParent(): PsiElement?
|
||||
abstract override fun getQualifiedName(): String?
|
||||
@@ -159,12 +157,12 @@ abstract class KtLightClassForSourceDeclaration(
|
||||
|
||||
val aClass = other as KtLightClassForSourceDeclaration
|
||||
|
||||
if (classFqName != aClass.classFqName) return false
|
||||
if (classOrObject != aClass.classOrObject) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int = classFqName.hashCode()
|
||||
override fun hashCode(): Int = classOrObject.hashCode()
|
||||
|
||||
override fun getContainingClass(): PsiClass? {
|
||||
if (classOrObject.parent === classOrObject.containingFile) return null
|
||||
@@ -186,7 +184,7 @@ abstract class KtLightClassForSourceDeclaration(
|
||||
|
||||
override fun getTypeParameters(): Array<PsiTypeParameter> = _typeParameterList.typeParameters
|
||||
|
||||
override fun getName(): String? = classFqName.shortName().asString()
|
||||
override fun getName(): String? = classOrObject.nameAsName?.asString()
|
||||
|
||||
private val _modifierList : PsiModifierList by lazy(LazyThreadSafetyMode.PUBLICATION) {
|
||||
object : KtLightModifierListWithExplicitModifiers(this@KtLightClassForSourceDeclaration, computeModifiers()) {
|
||||
|
||||
@@ -24,7 +24,10 @@ class KtLightClassImpl(
|
||||
classFqNameFunction: (KtClassOrObject) -> FqName,
|
||||
classOrObject: KtClassOrObject
|
||||
) : KtLightClassForSourceDeclaration(classFqNameFunction, classOrObject) {
|
||||
override fun getQualifiedName() = classFqName.asString()
|
||||
val fqName: FqName
|
||||
get() = fqName
|
||||
|
||||
override fun getQualifiedName() = classOrObject.fqName?.asString()
|
||||
|
||||
override fun getParent() = if (classOrObject.isTopLevel())
|
||||
containingFile
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.asJava.builder.LightMemberOrigin
|
||||
import org.jetbrains.kotlin.asJava.builder.LightMemberOriginForDeclaration
|
||||
import org.jetbrains.kotlin.asJava.classes.KtLightClass
|
||||
import org.jetbrains.kotlin.asJava.classes.KtLightClassForEnumEntry
|
||||
import org.jetbrains.kotlin.asJava.classes.KtLightClassImpl
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
@@ -140,7 +141,7 @@ sealed class KtLightFieldImpl(
|
||||
is PsiEnumConstant -> {
|
||||
val kotlinEnumEntry = (origin as? LightMemberOriginForDeclaration)?.originalElement as? KtEnumEntry
|
||||
val initializingClass = if (kotlinEnumEntry != null && kotlinEnumEntry.declarations.isNotEmpty()) {
|
||||
val enumConstantFqName = FqName(containingClass.getFqName().asString() + "." + kotlinEnumEntry.name)
|
||||
val enumConstantFqName = FqName((containingClass as KtLightClassImpl).fqName.asString() + "." + kotlinEnumEntry.name)
|
||||
KtLightClassForEnumEntry(enumConstantFqName, kotlinEnumEntry, delegate)
|
||||
}
|
||||
else null
|
||||
|
||||
Reference in New Issue
Block a user