The @TimedInterrupt annotation is designed to automatically add timeout checks to methods by inserting interruption checks at
strategic points in the code. However, this transformation is currently not compatible with static methods due to implementation limitations in how
the transformation processes method contexts.
When @TimedInterrupt is applied to a static method, it can lead to unexpected behavior or compilation issues because the
transformation logic assumes instance method semantics. The annotation works by injecting timeout verification code that may not function correctly in
a static context, potentially causing the timeout mechanism to fail silently or throw unexpected exceptions.
This incompatibility can result in unreliable timeout behavior, making it difficult to control long-running static operations as intended.
What is the potential impact?
Using @TimedInterrupt on static methods can lead to:
- Unreliable timeout behavior where the intended time limits are not enforced
- Potential compilation errors or runtime exceptions
- Silent failures where the timeout mechanism doesn’t work as expected
- Difficulty in controlling long-running static operations
- Unpredictable application behavior when timeouts should have been triggered