For example, I have thousands of methods like:
AA() {
...
}
BB() {
...
}
CC() {
...
}
etc ...
Now I want to call the printCurrentMethodName () method at the beginning of each method. It means that
AA() {
printCurrentMethodName();
...
}
BB() {
printCurrentMethodName();
...
}
CC() {
printCurrentMethodName();
...
}
etc ...
Including printCurrentMethodName () at the beginning of thousands of methods takes a lot of time.
Is there a way I can call printCurrentMethodName () at the beginning of each method without repeating it in those thousands of methods?
(I cannot use something like @Before or @BeforeMethod annotation because it will call printCurrentMethodName () before entering AA (), and therefore it will not print the method name as expected)
source
share