private static Class < ? > [ ] getCallStackViaSecurityManager ( final LogNode log ) { try { return new CallerResolver ( ) . getClassContext ( ) ; } catch ( final SecurityException e ) { // Creating a SecurityManager can fail if the current SecurityManager does not allow // RuntimePermission("createSecurityManager") if ( log != null ) { log . log ( "Exception while trying to obtain call stack via SecurityManager" , e ) ; } return null ; } }
Get the call stack via the SecurityManager API .