Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5063021

protection domain not used in redefine classes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 5.0
    • hotspot
    • generic
    • generic

    Description

      Found by code inspections, not yet tested. The following code creates the new version of the class, but does not set the protection_domain. One would think that it should be copied from the old class, just like class_loader it. It would appear that there is at least one bug caused by this (again just by inspection), the ClassFileParser sends the ClassFileLoadHook event, this is sent with the passed in (unset) protection domain ---

          // Parse the stream.
          Handle k_loader_h(THREAD, k_h->class_loader());
          Handle protection_domain;
          // Set redefined class handle in JvmtiThreadState class.
          // This redefined class is sent to agent event handler for class file
          // load hook event.
          state->set_class_being_redefined(&k_h);

          klassOop k = SystemDictionary::parse_stream(k_name,
                                                      k_loader_h,
                                                      protection_domain,
                                                      &st,
                                                      THREAD);


      The protection_domain is not copied from the new class version so should not impact the actual protection_domain of the class.

      Attachments

        Issue Links

          Activity

            People

              dcubed Daniel Daugherty
              rfield Robert Field (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: