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

Inner classes must be addressed as package.OuterClass$InnerClass instead of package.OuterClass.InnerClass

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.1.1
    • 2.1.0
    • Documentation
    • None

      My source code looks like this:

      package test.byteman;
      
      public class OuterClass {
      	// ...
      	
      	public static class InnerClass {
      		// ...
      	}
      }
      

      When addressing InnerClass, I would have expected to use a CLASS statement like this:

      CLASS test.byteman.OuterClass.InnerClass
      

      But Byteman does not see a class matching this statement. When I change it to

      CLASS test.byteman.OuterClass$InnerClass
      

      Byteman sees the class and applies the rule. I would either expect the former statement to work (possibly in addition to the $ notation) or this behavior to be documented with the CLASS statement.

      Example rule:

      RULE trace call
      CLASS test.byteman.OuterClass$InnerClass
      METHOD myMethod
      AT ENTRY
      IF true
      DO System.err.println("entering method")
      ENDRULE
      

              rhn-engineering-adinn Andrew Dinn
              jetztgradnet Wolfgang Schell (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: