public static final String makeJavaIdentifier(String identifier){
  StringBuilder modifiedIdentifier=new StringBuilder(identifier.length());
  if (!Character.isJavaIdentifierStart(identifier.charAt(0))) {
    modifiedIdentifier.append('_');
  }
  for (int i=0; i < identifier.length(); i++) {
    char ch=identifier.charAt(i);
    if (Character.isJavaIdentifierPart(ch) && ch != '_') {
      modifiedIdentifier.append(ch);
    }
 else     if (ch == '.') {
      modifiedIdentifier.append('_');
    }
 else {
      modifiedIdentifier.append(mangleChar(ch));
    }
  }
  if (isJavaKeyword(modifiedIdentifier.toString())) {
    modifiedIdentifier.append('_');
  }
  return modifiedIdentifier.toString();
}

public static final String makeJavaIdentifier ( String identifier ) { StringBuilder modifiedIdentifier = new StringBuilder ( identifier . length ( ) ) ; if ( ! Character . isJavaIdentifierStart ( identifier . charAt ( 0 ) ) ) { modifiedIdentifier . append ( '_' ) ; } for ( int i = 0 ; i < identifier . length ( ) ; i ++ ) { char ch = identifier . charAt ( i ) ; if ( Character . isJavaIdentifierPart ( ch ) && ch != '_' ) { modifiedIdentifier . append ( ch ) ; } else if ( ch == '.' ) { modifiedIdentifier . append ( '_' ) ; } else { modifiedIdentifier . append ( mangleChar ( ch ) ) ; } } if ( isJavaKeyword ( modifiedIdentifier . toString ( ) ) ) { modifiedIdentifier . append ( '_' ) ; } return modifiedIdentifier . toString ( ) ; }
converts the given identifier to a legal java identifier
