Google search bar

March 24, 2011

My Code Fixes: Runtime Class and Method information

Turns out you can get current thread using Thread.currentThread()

With that thread you can call getStackTrace(). This allows you to get the current class and method name from stackTrace[0] (stackTrace being the result of getStackTrace()).

You, of course, have to be in a context where this code executes on the same thread.

Thanks to .

My Code Fixes: Runtime Class and Method information

No comments: