Move under debug log message when nested class is not found
To avoid freezes and useless reporting calculations #KTIJ-25465 Fixed Merge-request: KT-MR-10996 Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
b5eafb9eb7
commit
c1b70a7303
+20
-18
@@ -253,25 +253,27 @@ private class ClassClsStubBuilder(
|
|||||||
val (nameResolver, classProto, _, sourceElement) =
|
val (nameResolver, classProto, _, sourceElement) =
|
||||||
c.components.classDataFinder.findClassData(nestedClassId)
|
c.components.classDataFinder.findClassData(nestedClassId)
|
||||||
?: c.components.virtualFileForDebug.let { rootFile ->
|
?: c.components.virtualFileForDebug.let { rootFile ->
|
||||||
val outerClassId = nestedClassId.outerClassId
|
if (LOG.isDebugEnabled) {
|
||||||
val sortedChildren = rootFile.parent.children.sortedBy { it.name }
|
val outerClassId = nestedClassId.outerClassId
|
||||||
val msgPrefix = "Could not find data for nested class $nestedClassId of class $outerClassId\n"
|
val sortedChildren = rootFile.parent.children.sortedBy { it.name }
|
||||||
val explanation = when {
|
val msgPrefix = "Could not find data for nested class $nestedClassId of class $outerClassId\n"
|
||||||
outerClassId != null && sortedChildren.none { it.name.startsWith("${outerClassId.relativeClassName}\$a") } ->
|
val explanation = when {
|
||||||
// KT-29427: case with obfuscation
|
outerClassId != null && sortedChildren.none { it.name.startsWith("${outerClassId.relativeClassName}\$a") } ->
|
||||||
"Reason: obfuscation suspected (single-letter name)\n"
|
// KT-29427: case with obfuscation
|
||||||
else ->
|
"Reason: obfuscation suspected (single-letter name)\n"
|
||||||
// General case
|
else ->
|
||||||
""
|
// General case
|
||||||
|
""
|
||||||
|
}
|
||||||
|
val msg = msgPrefix + explanation +
|
||||||
|
"Root file: ${rootFile.canonicalPath}\n" +
|
||||||
|
"Dir: ${rootFile.parent.canonicalPath}\n" +
|
||||||
|
"Children:\n" +
|
||||||
|
sortedChildren.joinToString(separator = "\n") {
|
||||||
|
"${it.name} (valid: ${it.isValid})"
|
||||||
|
}
|
||||||
|
LOG.debug(msg)
|
||||||
}
|
}
|
||||||
val msg = msgPrefix + explanation +
|
|
||||||
"Root file: ${rootFile.canonicalPath}\n" +
|
|
||||||
"Dir: ${rootFile.parent.canonicalPath}\n" +
|
|
||||||
"Children:\n" +
|
|
||||||
sortedChildren.joinToString(separator = "\n") {
|
|
||||||
"${it.name} (valid: ${it.isValid})"
|
|
||||||
}
|
|
||||||
LOG.info(msg)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
createClassStub(classBody, classProto, nameResolver, nestedClassId, sourceElement, c)
|
createClassStub(classBody, classProto, nameResolver, nestedClassId, sourceElement, c)
|
||||||
|
|||||||
Reference in New Issue
Block a user