Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use byte-buddy to handle annotation #1494

Closed
SuperDubbo opened this issue Jul 27, 2023 · 3 comments
Closed

how to use byte-buddy to handle annotation #1494

SuperDubbo opened this issue Jul 27, 2023 · 3 comments
Assignees
Labels
Milestone

Comments

@SuperDubbo
Copy link

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
Copy link
Author

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
Copy link
Author

image

@raphw raphw self-assigned this Aug 6, 2023
@raphw raphw added the question label Aug 6, 2023
@raphw raphw added this to the 1.14.5 milestone Aug 6, 2023
@raphw
Copy link
Owner

raphw commented Aug 6, 2023

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

@raphw raphw closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants