Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-175

Type checker should not generate error for throw Error rule even though it is not declared by the target class

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Minor Minor
    • 2.0.0
    • 1.6.0
    • Parser/Type Checker
    • None

      I was trying to neutralize a thread using Byteman but unfortunately/fortunately the way Thread is written these days this is not so simple. The ThreadDeath raised by my rule by calling Thread.stop() (there is byteman specific way to do this killThread but that has the same issue) is handled by my code which is resilient and as such it catches RuntimeExceptions, it doesn't handle Errors though (due to domain specific justification).

      Therefore I figured, OK, I will throw an Error in my rule to neutralize this thread.

      Unfortunately byteman does not allow throwing undeclared Errors out of the target method of a rule. I have worked around this for now by declaring my method can throw an Error.

              rhn-engineering-adinn Andrew Dinn
              thjenkin@redhat.com Tom Jenkinson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: