sO getMainClassForThread(Thread t) { if (t == null) null; try object getMainClass(t); ret getMainClass(callOpt(t, "getTarget")); // BetterThread }