byte-buddy icon indicating copy to clipboard operation
byte-buddy copied to clipboard

Add annotation for Advice to annotate placeholder methods in the same class

Open raphw opened this issue 7 years ago • 0 comments

It should be possible to annotate methods in the class of an advice class that are used to represent another available method such as a private method or a super method that cannot be represented in the template byte code. For example:

class MyAdvice {
  @Advice.OnMethodEnter
  static void advice(@Advice.This Foo self) {
    somePrivateMethod(self, "abc");
  }
  @Advice.Substitute(target = Foo.class, name = "bar")
  static void somePrivateMethod(Foo self, String arg) { }
}

raphw avatar Jun 03 '18 09:06 raphw