diff --git a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerManager.kt b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerManager.kt index 4855f190d7fe..c5a2e3721393 100644 --- a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerManager.kt +++ b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerManager.kt @@ -29,23 +29,23 @@ public object ByteCodeViewerManager { .first() } - public fun findClassFile(aClass: PsiClass): VirtualFile? { - val fileClass = aClass.containingClassFileClass() + public fun findClassFile(psiClass: PsiClass): VirtualFile? { + val fileClass = psiClass.containingClassFileClass() for (finder in CLASS_FINDER_EP.extensionList) { - val vFile = finder.findClass(aClass, fileClass) + val vFile = finder.findClass(psiClass, fileClass) if (vFile != null) { return vFile } } val file = fileClass.originalElement.containingFile.virtualFile ?: return null - val jvmClassName = ClassUtil.getBinaryClassName(aClass) ?: return null - return if (FileTypeRegistry.getInstance().isFileOfType(file, JavaClassFileType.INSTANCE)) { + val jvmClassName = ClassUtil.getBinaryClassName(psiClass) ?: return null + if (FileTypeRegistry.getInstance().isFileOfType(file, JavaClassFileType.INSTANCE)) { // compiled class; looking for the right .class file (inner class 'A.B' is "contained" in 'A.class', but we need 'A$B.class') - file.parent.findChild(StringUtil.getShortName(jvmClassName) + ".class") + return file.parent.findChild(StringUtil.getShortName(jvmClassName) + ".class") } else { // source code; looking for a .class file in compiler output - val fileIndex = ProjectFileIndex.getInstance(aClass.project) + val fileIndex = ProjectFileIndex.getInstance(psiClass.project) val module = fileIndex.getModuleForFile(file) ?: return null val compilerModuleExtension = CompilerModuleExtension.getInstance(module) ?: return null val classRoot = when (fileIndex.isInTestSourceContent(file)) { @@ -85,8 +85,8 @@ public object ByteCodeViewerManager { val queue: Queue = ArrayDeque(listOf(*containingFile.getClasses())) while (!queue.isEmpty()) { val c = queue.remove() - val navigationElement: PsiElement? = c.getNavigationElement() - val classRange = navigationElement?.getTextRange() + val navigationElement: PsiElement = c.getNavigationElement() + val classRange = navigationElement.getTextRange() if (classRange != null && classRange.contains(textRange)) { result = c queue.clear()