Skip to content

Commit 37e2314

Browse files
committed
Don't try to decode a class from a .java file
1 parent ecfbb65 commit 37e2314

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java/kotlin-extractor/src/main/kotlin/utils/ClassNames.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ fun getIrClassVirtualFile(irClass: IrClass): VirtualFile? {
9090
}
9191
}
9292
is VirtualFileBasedSourceElement -> {
93-
return cSource.virtualFile
93+
if (cSource.virtualFile.name.endsWith(".class")) {
94+
// At least lately, despite VirtualFileBasedSourceElement being constructed on a BinaryJavaClass,
95+
// this can be a .java source file.
96+
return cSource.virtualFile
97+
}
9498
}
9599
is KotlinJvmBinarySourceElement -> {
96100
val binaryClass = cSource.binaryClass

0 commit comments

Comments
 (0)