How to know the call class of a function

advertisements

Hello is there a way to know the caller class name of a function, specifically for a Java-GWT application?


Thread.currentThread is not supported in GWT (remember that java code gets compiled to javascript), so this is a possible duplicate of:

How do you find out the caller function in JavaScript?

In GWT you'd simply write a jsni wrapper:

public static native void whosMyCaller() /*-{
    $wnd.alert(arguments.callee.caller.toString());
}-*/;