Fixed inadvertent dependency on Java 8 runtime

Changed references to type.getTypeName() to ((Class)type).getName() to
be Java 6 compliant.