John,
That might be an issue here. Just as (String)null and (String)"" are distinct values in
Java, in the class file a CP ref of zero differs from a CP ref to a CONSTANT_Utf8 of the empty
string "". But the method Class.isAnonymousClass does not make a distinction between
those two cases, which might sometimes lead to confusion. I would view this as a bug in
Class.isAnonymousClass.
For non-top level classes, Class.getSimpleName calls
Class.getSimpleBinaryName which converts null to empty string, assuming
it's an anonymous class. So, callers should not see null values.
Best regards,
Vladimir Ivanov