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

how to use byte-buddy to handle annotation

Open SuperDubbo opened this issue 1 year ago • 3 comments

Regarding the use of byte-buddy, I have 2 questions, which are as follows:

  1. How to remove the annotation above the class;
  2. How to change the attribute value in the annotation of the class attribute; In order to avoid that I did not make it clear, I will give the corresponding example below. Example 1: I just want to remove the @Aspect annotation on class A. before
@Aspect
@Slf4j
Class A{

}

after

@Slf4j
Class A{

}

Example 2: I want to change the value of name in the @Resource annotation of attribute a in class B from a to b before

Class B{
    @Resource(name="a")
    private A a;
}

after

Class B{
    @Resource(name="b")
    private A a;
}

SuperDubbo avatar Jul 27 '23 01:07 SuperDubbo

Referring to this issue, I found a solution, but the solution time of the above issue is in 2020. With the recent upgrades, is there a simpler and more suitable alternative?

SuperDubbo avatar Aug 04 '23 02:08 SuperDubbo

image

SuperDubbo avatar Aug 04 '23 02:08 SuperDubbo

As pointed out, removal is not currently well-supported. Unfortunately, this is still true today.

raphw avatar Aug 06 '23 21:08 raphw