How to get the name of the current method in Java

There is a simple solution, to get the name of the current method in Java. It uses the stack trace to get the name of the mehod. It works with different virtual machines like oracle, dalvik (Android), Open JDK, etc.

But don’t use this in time-critical code, because working with the StackTrace is not recommended for high performcnce activities.

Source: http://stackoverflow.com/