try {
a();
b();
c();
} catch (Exception ex) {
StackTraceElement[] a = ex.getStackTrace();
String methodName = a[a.length - 2].getMethodName();
System.out.println("methodName = " + methodName);
}