You are right, ```.getClass().getName()``` is more appropriate, and certainly better than the reflection hack.