Files
codeql/java/kotlin-extractor
Anders Fugmann 97199fdc39 Kotlin: make KDoc-section PCE rethrow portable across compiler versions
The KDoc-section parser added for the K2/FIR frontend caught
`com.intellij.openapi.progress.ProcessCanceledException` by type in order to
rethrow it (a control-flow exception that must never be swallowed) before the
general `catch (Exception)` fallback.

That compile-time type reference is not resolvable on every supported Kotlin
compiler version: the IntelliJ classes bundled in the compiler-embeddable
classpath vary across the versions in `versions.bzl`. It compiled under 2.3.20
and 2.4.0 (so the language-test builds were green) but failed the internal
extractor build with `unresolved reference 'ProcessCanceledException'`.

Match the exception by class name instead of by type. This keeps the exact
same behaviour (the cancellation exception is still rethrown, everything else
is logged and yields null) while removing the only compile-time reference to a
class that is not present on every version's classpath. Verified the standalone
extractor now builds for 1.9.20-Beta, 2.0.0-RC1 and 2.4.0.

No expected-output changes: the runtime behaviour is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-14 09:03:59 +02:00
..
2022-05-10 18:45:56 +01:00
2025-05-13 14:42:05 +01:00
2022-05-10 18:45:51 +01:00