I am using
new Throwable().getStackTrace()[1].getMethodName()
It is termed as expensive by some developers. In what way this method is expensive? Shall we use it and if yes then what caution should be taken?
In my use case, it is very much required to find calling method name.
There are around 50 jobs so this will get executed around 100 times on 32 gb ram centos in a standalone program in Java8.