Rename CompanionObjectMapping.hasMappingToObject -> isMappedIntrinsicCompanionObject
This commit is contained in:
@@ -103,6 +103,6 @@ public final class JvmAbi {
|
||||
public static boolean isCompanionObjectWithBackingFieldsInOuter(@NotNull DeclarationDescriptor companionObject) {
|
||||
return isCompanionObject(companionObject) &&
|
||||
isClassOrEnumClass(companionObject.getContainingDeclaration()) &&
|
||||
!CompanionObjectMapping.INSTANCE.hasMappingToObject((ClassDescriptor) companionObject);
|
||||
!CompanionObjectMapping.INSTANCE.isMappedIntrinsicCompanionObject((ClassDescriptor) companionObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ object CompanionObjectMapping {
|
||||
fun allClassesWithIntrinsicCompanions(): Set<FqName> =
|
||||
Collections.unmodifiableSet(classesFqNames)
|
||||
|
||||
fun hasMappingToObject(classDescriptor: ClassDescriptor): Boolean {
|
||||
fun isMappedIntrinsicCompanionObject(classDescriptor: ClassDescriptor): Boolean {
|
||||
if (!DescriptorUtils.isCompanionObject(classDescriptor)) return false
|
||||
val fqName = DescriptorUtils.getFqName(classDescriptor.containingDeclaration)
|
||||
if (!fqName.isSafe) return false
|
||||
|
||||
@@ -128,7 +128,7 @@ internal class KClassImpl<T : Any>(override val jClass: Class<T>) :
|
||||
val descriptor = descriptor
|
||||
if (descriptor.kind != ClassKind.OBJECT) return@lazy null
|
||||
|
||||
val field = if (descriptor.isCompanionObject && !CompanionObjectMapping.hasMappingToObject(descriptor)) {
|
||||
val field = if (descriptor.isCompanionObject && !CompanionObjectMapping.isMappedIntrinsicCompanionObject(descriptor)) {
|
||||
jClass.enclosingClass.getDeclaredField(descriptor.name.asString())
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user