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

NPE if RuleCheckMethodAdapter.checkBindings() doesn't find a match because of using wrong variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.3
    • 2.0.1
    • Trigger Injection
    • None

      Near the end of RuleCheckMethodAdapter.checkBindings() in the "if (binding.isLocalVar())" block, it sets 'descriptor' to null and has a loop which sets 'descriptor' when a match is found.

      In the following "if (!found)" block, it uses 'descriptor' despite the fact it is going to be null since no match was found. It is using the wrong variable, and needs to pass 'this.descriptor' rather than 'descriptor' to transformContext.warn(). Not shadowing the member variable with a local variable of the same name to avoid accidents may be a good idea.

      I originally produced this trying to access an exception ($e) in a catch block using AT LINE, but haven't managed to find a trivial reproducer.

              rhn-engineering-adinn Andrew Dinn
              rhn-support-jlivings James Livingston (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: