Use class eq checking instead of reflection as getCanonicalName has a la...

...rge overhead