public static String getSimpleName ( Class < ? > klass ) { String simpleName = klass . getSimpleName ( ) ; if ( simpleName . isEmpty ( ) ) { String fullName = klass . getName ( ) ; int index = fullName . lastIndexOf ( ' ' ) ; simpleName = ( index < 0 ) ? fullName : fullName . substring ( index + 1 ) ; } return simpleName ; }
Avoids getting dumb empty names for anonymous inners .