Java: Account for AssertionError possibly not being extracted.

This commit is contained in:
Anders Schack-Mulligen
2025-06-26 11:03:59 +02:00
parent 326f2b0498
commit c091fc585b

View File

@@ -347,7 +347,17 @@ private module ControlFlowGraphImpl {
)
}
private ThrowableType assertionError() { result.hasQualifiedName("java.lang", "AssertionError") }
private ThrowableType actualAssertionError() {
result.hasQualifiedName("java.lang", "AssertionError")
}
private ThrowableType assertionError() {
result = actualAssertionError()
or
// In case `AssertionError` is not extracted, we use `Error` as a fallback.
not exists(actualAssertionError()) and
result.hasQualifiedName("java.lang", "Error")
}
/**
* Gets an exception type that may be thrown during execution of the