There is a synchronized code block shown as below:
public class Counter {
int count;
public void increment(){
synchronized(this){
this.count ++;
}
}
}
I know how to use bytebuddy to intercept the instrument method. Can bytebuddy intercept the synchronized code block as well?
My ultimate goal is to inject my own code in the beginning or the end of the code block.