question: public static String toDisplayName ( String s ) { Object [ ] components = parseBytecodeName ( s ) ; for ( int i = 0 ; i < components . length ; i ++ ) { if ( ! ( components [ i ] instanceof String ) ) continue ; String sn = ( String ) components [ i ] ; if ( ! isJavaIdent ( sn ) || sn . indexOf ( '$' ) >= 0 ) { components [ i ] = quoteDisplay ( sn ) ; } } return appendAll ( components ) ; }
target:  Given a bytecode name, produce the corresponding display name. This is the source name, plus quotes if needed. If the bytecode name contains dangerous characters, assume that they are being used as punctuation, and pass them through unchanged. Non-empty runs of non-dangerous characters are demangled if necessary, and the resulting names are quoted if they are not already valid Java identifiers, or if they contain a dangerous character (i.e., dollar sign "$"). Single quotes are used when quoting. Within quoted names, embedded single quotes and backslashes are further escaped by prepended backslashes.