Fix light classes exception occurring on obfuscated Kotlin libraries
^KT-29454 Fixed
This commit is contained in:
+5
-6
@@ -276,11 +276,10 @@ open class IDEKotlinAsJavaSupport(private val project: Project) : KotlinAsJavaSu
|
|||||||
val relativeFqName = getClassRelativeName(decompiledClassOrObject) ?: return null
|
val relativeFqName = getClassRelativeName(decompiledClassOrObject) ?: return null
|
||||||
val iterator = relativeFqName.pathSegments().iterator()
|
val iterator = relativeFqName.pathSegments().iterator()
|
||||||
val base = iterator.next()
|
val base = iterator.next()
|
||||||
assert(rootLightClassForDecompiledFile.name == base.asString()) {
|
|
||||||
"Light class for file:\n" + decompiledClassOrObject.containingKtFile.virtualFile.canonicalPath +
|
// In case class files have been obfuscated (i.e., SomeClass belongs to a.class file), just ignore them
|
||||||
"\nwas expected to have name: " + base.asString() +
|
if (rootLightClassForDecompiledFile.name != base.asString()) return null
|
||||||
"\n Actual: " + rootLightClassForDecompiledFile.name
|
|
||||||
}
|
|
||||||
var current: KtLightClassForDecompiledDeclaration = rootLightClassForDecompiledFile
|
var current: KtLightClassForDecompiledDeclaration = rootLightClassForDecompiledFile
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
val name = iterator.next()
|
val name = iterator.next()
|
||||||
@@ -349,4 +348,4 @@ open class IDEKotlinAsJavaSupport(private val project: Project) : KotlinAsJavaSu
|
|||||||
|
|
||||||
internal fun PsiElement.getModuleInfoPreferringJvmPlatform(): IdeaModuleInfo {
|
internal fun PsiElement.getModuleInfoPreferringJvmPlatform(): IdeaModuleInfo {
|
||||||
return getPlatformModuleInfo(JvmPlatforms.unspecifiedJvmPlatform) ?: getModuleInfo()
|
return getPlatformModuleInfo(JvmPlatforms.unspecifiedJvmPlatform) ?: getModuleInfo()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user