diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta/CommentExtractorLighterAST.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta/CommentExtractorLighterAST.kt index 062f38e33dd..fc954f2cdfd 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta/CommentExtractorLighterAST.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta/CommentExtractorLighterAST.kt @@ -66,9 +66,15 @@ class CommentExtractorLighterAST( org.jetbrains.kotlin.kdoc.psi.api.KDoc::class.java ) kdoc?.getAllSections() - } catch (e: com.intellij.openapi.progress.ProcessCanceledException) { - throw e } catch (e: Exception) { + // Never swallow IntelliJ's ProcessCanceledException: it is a control-flow + // exception that must propagate for cancellation to work. We match it by + // name rather than by type because the class is not resolvable on every + // supported compiler version (its embeddable classpath varies), and a + // compile-time reference breaks the cross-version build. + if (e.javaClass.name == "com.intellij.openapi.progress.ProcessCanceledException") { + throw e + } logger.warn("Couldn't parse KDoc sections: ${e}") null }