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

Reimplement sun.reflect.ReflectionFactory::newConstructorForSerialization with method handles

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 22
    • 22
    • core-libs

    Description

      sun.reflect.ReflectionFactory::newConstructorForSerialization is JDK unsupported API used by 3rd party serialization framework.

      This API currently generates the bytecode which fails the verification because `new C; invokespecial A()` where the given class `C` and invoke a no-arg constructor of `C`'s first non-`Serializable` superclass `A` is not a valid operation per the VM specification. VM special cases the classes generated for reflection to skip verification for the constructors generated for serialization and externalization. See [1] for details.

      Reimplementing ReflectionFactory::newConstructorForSerialization with method handles will allow the VM hack to be removed.

      [1] https://bugs.openjdk.org/browse/JDK-8305104?focusedCommentId=14570146&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14570146

      Attachments

        Issue Links

          Activity

            People

              mchung Mandy Chung
              mchung Mandy Chung
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: