diff --git a/common-util/src/main/kotlin/com/google/devtools/ksp/common/impl/KSNameImpl.kt b/common-util/src/main/kotlin/com/google/devtools/ksp/common/impl/KSNameImpl.kt index 0cbccba79d..c3475aa2a9 100644 --- a/common-util/src/main/kotlin/com/google/devtools/ksp/common/impl/KSNameImpl.kt +++ b/common-util/src/main/kotlin/com/google/devtools/ksp/common/impl/KSNameImpl.kt @@ -13,10 +13,12 @@ class KSNameImpl private constructor(val name: String) : KSName { } override fun getQualifier(): String { - return name.split(".").dropLast(1).joinToString(".") + val lastIndex = name.lastIndexOf('.') + return if (lastIndex != -1) name.substring(0, lastIndex) else "" } override fun getShortName(): String { - return name.split(".").last() + val lastIndex = name.lastIndexOf('.') + return if (lastIndex != -1) name.substring(lastIndex + 1) else name } }