I tried both ways on scala REPL, they're giving the same results. But I think you're right, t.getClass.getName is more type-safe.
I will also move these lines to RichXHandler and come up with certian tests. Thanks for suggestion.