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

Byteman invalidly recording tarnsforms when no injection performed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.4.0
    • 1.3.0
    • Trigger Injection
    • None

      Class RuleTriggerMethodAdapter is extended by all trigger adapters and encapsulates the functionality required to inject a trigger into a target method. It records a transform operation unconditionally at the end of the bytecode visit sequence. This is fine if the underlying adapter does actually inject a trigger point but is a problem if the rule fails to match a suitable location.

      For example

      RULE test case
      CLASS foo
      METHOD bar
      AT CALL baz
      IF TRUE
      DO traceln("alas poor yorick")
      ENDRULE

      will record a successful transform if foo has a method bar even if it does not call baz. No injection will occur so no harm is done as far as execution is concerned. However, this does provide false info to listener clients. It also breaks the type checker with a NPE when it tries to process the false match because it gets handed a rule which has no attached info for the target type, trigger method descriptor etc.

            rhn-engineering-adinn Andrew Dinn
            rhn-engineering-adinn Andrew Dinn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: