iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNNameParser.java
private static String escape(String str) {
        if (str.indexOf(kindSeparator) < 0 &&
                str.indexOf(compSeparator) < 0 &&
                str.indexOf(escapeChar) < 0) {
            return str;                         // no meta characters to escape
        } else {
            int len = str.length();
            int j = 0;
            char[] newStr = new char[len + len];
            for (int i = 0; i < len; i++) {
                if (isMeta(str.charAt(i))) {
                    newStr[j++] = escapeChar;   // escape meta character
                }
                newStr[j++] = str.charAt(i);
            }
            return new String(newStr, 0, j);
        }
    }
private static String escape(String str) {
        if (str.indexOf(kindSeparator) < 0 &&
                str.indexOf(compSeparator) < 0 &&
                str.indexOf(escapeChar) < 0) {
            return str;                         // no meta characters to escape
        } else {
            int len = str.length();
            int j = 0;
            char[] newStr = new char[len + len];
            for (int i = 0; i < len; i++) {
                if (isMeta(str.charAt(i))) {
                    newStr[j++] = escapeChar;   // escape meta character
                }
                newStr[j++] = str.charAt(i);
            }
            return new String(newStr, 0, j);
        }
    }
private static String escape ( String str ) { if ( str . indexOf ( kindSeparator ) < 0 && str . indexOf ( compSeparator ) < 0 && str . indexOf ( escapeChar ) < 0 ) { return str ; // no meta characters to escape } else { int len = str . length ( ) ; int j = 0 ; char [ ] newStr = new char [ len + len ] ; for ( int i = 0 ; i < len ; i ++ ) { if ( isMeta ( str . charAt ( i ) ) ) { newStr [ j ++ ] = escapeChar ; // escape meta character } newStr [ j ++ ] = str . charAt ( i ) ; } return new String ( newStr , 0 , j ) ; } }
Returns a string with '.', '\', '/' escaped. Used when
stringifying the name into its INS stringified form.
Returns a string with . \ / escaped . Used when stringifying the name into its INS stringified form .