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);
}

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 ) ; }
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 .
