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

AT ENTRY trigger is not injected unless class is compiled with line number info included

    XMLWordPrintable

Details

    • Workaround Exists
    • Hide

      Compiling the target class with line number info included (javac -g or javac -g:lines) will enable trigger injection to work

      Show
      Compiling the target class with line number info included (javac -g or javac -g:lines) will enable trigger injection to work

    Description

      If a target class is compiled without line number information then an AT ENTRY trigger fails to match the target method. This is counter-intuitive since there is no need to know what line the method starts on in order to know that it starts somewhere.

      This is actually because the AT ENTRY location specifier is treated internally as if it were an AT LINE -1 location specifier. This is a cheap hack which allows AT ENTRY injection to be done using the same mechanism as implements AT LINE injection. When the AT LINE trigger injector's visitLineNUmber method is first called for a matching method it identifies that the visited line number > -1 and so marks the current bytecode location as the trigger point. The only problem is that in the absence of line number information the visitLineNumber method never gets called.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: