We have a requirement where we would like to retrieve Calling Class name(with Package structure)and use it inside the called class.
I have searched and found out two ways ...
1) String callingClassName = new Throwable().fillInStackTrace().getStackTrace().getClassName();
2) String callingClassName =
but these two approaches pose performance issue as both take arround 15-16 millisecond to execute, which is not acceptable in large application.
Any other suggestions or enhancement to above two approach would be highly appreciated.