public void funkyMethod() { System.err.println(new Exception().getStackTrace()[0].getMethodName()); }
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/vzwG6uK3mWQ/11561