[lworld] JNI MonitorEnter uses the wrong exception message for value classes

XMLWordPrintable

      The code is actually in ObjectSynchronizer::jni_enter:

      if (obj->klass()->is_inline_klass()) {
          ResourceMark rm(THREAD);
          const char* desc = "Cannot synchronize on an instance of value class ";
          const char* className = obj->klass()->external_name();
          size_t msglen = strlen(desc) + strlen(className) + 1;
          char* message = NEW_RESOURCE_ARRAY(char, msglen);
          assert(message != nullptr, "NEW_RESOURCE_ARRAY should have called vm_exit_out_of_memory and not return nullptr");
          THROW_MSG(vmSymbols::java_lang_IdentityException(), className);
        }

      The code omits copying the message text to the new array, and just uses the classname as the exception message.

            Assignee:
            David Holmes
            Reporter:
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: