byte-buddy
byte-buddy copied to clipboard
How can I modify Annotation's field on method?
like this ->
before:
@MyAnnotation(param1="A")
public Object m1(){
//.......
}
after:
@MyAnnotation(param1="B")
public Object m1(){
//.......
}
Is it possible by using bytebuddy lib ?
It is, but likely it would be best to use ASM. Alternatively, you can use AnnotationRemoval and then add a new annotation. This might however be more costly than necessary for such a simple adjustment.