new Object(){}.getClass().getEnclosingMethod().getName(); Thread.currentThread().getStackTrace() 转载于:https://www.cnblogs.com/gotodsp/p/8405547.html