--- old/src/hotspot/share/oops/instanceKlass.cpp 2020-04-12 17:29:55.000000000 -0700 +++ new/src/hotspot/share/oops/instanceKlass.cpp 2020-04-12 17:29:54.000000000 -0700 @@ -2679,25 +2679,25 @@ // Add the actual class name for (int src_index = 0; src_index < src_length; ) { + if (is_hidden() && src[src_index] == '+') { + // Replace the last '+' with a ';' followed with '/'. + dest[dest_index++] = JVM_SIGNATURE_ENDCLASS; + dest[dest_index++] = JVM_SIGNATURE_SLASH; + src_index++; + continue; + } dest[dest_index++] = src[src_index++]; } - if (is_hidden()) { // Replace the last '+' with a '.'. - for (int index = (int)src_length; index > 0; index--) { - if (dest[index] == '+') { - dest[index] = JVM_SIGNATURE_DOT; - break; - } - } - } - // If we have a hash, append it for (int hash_index = 0; hash_index < hash_len; ) { dest[dest_index++] = hash_buf[hash_index++]; } // Add the semicolon and the NULL - dest[dest_index++] = JVM_SIGNATURE_ENDCLASS; + if (!is_hidden()) { + dest[dest_index++] = JVM_SIGNATURE_ENDCLASS; + } dest[dest_index] = '\0'; return dest; }