Is there a way to get the name of the currently executing method in Java?
public class SomeClass { public void foo(){ class Local {}; String name = Local.class.getEnclosingMethod().getName(); } }
name will have value foo.