bringing back mayThrowException to make it cleaner/easier for backwards compatibility.

This commit is contained in:
REDMOND\brodes
2024-11-19 13:17:10 -05:00
parent 63ddd81059
commit 07847762e1
2 changed files with 4 additions and 17 deletions

View File

@@ -66,23 +66,10 @@ abstract class ThrowingFunction extends ExceptionAnnotation {
* Do not specify `none()` if no exception is raised, instead use the
* `NonThrowingFunction` class instead.
*/
abstract predicate raisesException(boolean unconditional);
/**
* DEPRECATES: use/extend `raisesException` instead.
*/
deprecated predicate mayThrowException(boolean unconditional){
this.raisesException(unconditional)
}
abstract predicate mayThrowException(boolean unconditional);
/**
* Holds if this function will always raise an exception if called
*/
final predicate alwaysRaisesException() { this.raisesException(true) }
/**
* Holds if this function may raise an exception if called but
* it is not guaranteed to do so. I.e., the function does not always raise an exception.
*/
final predicate mayRaiseException() { this.raisesException(false) }
final predicate alwaysRaisesException() { this.mayThrowException(true) }
}