--- old/src/hotspot/share/oops/objArrayKlass.cpp 2020-04-12 17:29:57.000000000 -0700 +++ new/src/hotspot/share/oops/objArrayKlass.cpp 2020-04-12 17:29:57.000000000 -0700 @@ -110,11 +110,31 @@ if (element_klass->is_instance_klass()) { // it could be an array or simple type new_str[idx++] = JVM_SIGNATURE_CLASS; } + memcpy(&new_str[idx], name_str, len * sizeof(char)); idx += len; + if (element_klass->is_instance_klass()) { - new_str[idx++] = JVM_SIGNATURE_ENDCLASS; + if (element_klass->is_hidden()) { + // the name of an array of hidden class is of the form "[L;/" + // is the binary name of the original class file in internal form + // is the suffix + int end_class = -1; + for (int j = idx-1; j > 0; j--) { + new_str[j+1] = new_str[j]; + if (new_str[j] == '+') { + end_class = j; + break; + } + } + // Insert ';' before '+' character + assert(end_class > 0 && end_class < idx, "invalid hidden class name"); + new_str[end_class] = JVM_SIGNATURE_ENDCLASS; + } else { + new_str[idx++] = JVM_SIGNATURE_ENDCLASS; + } } + new_str[idx++] = '\0'; name = SymbolTable::new_permanent_symbol(new_str); if (element_klass->is_instance_klass()) {