< prev index next >

src/hotspot/share/oops/objArrayKlass.cpp

Print this page
rev 58769 : imported patch type-descriptor-name

@@ -108,15 +108,35 @@
     int idx = 0;
     new_str[idx++] = JVM_SIGNATURE_ARRAY;
     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()) {
+      if (element_klass->is_hidden()) {
+        // the name of an array of hidden class is of the form "[L<N>;/<S>"
+        // <N> is the binary name of the original class file in internal form
+        // <S> 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()) {
       InstanceKlass* ik = InstanceKlass::cast(element_klass);
       ik->set_array_name(name);
< prev index next >