Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8271820 Implementation of JEP 416: Reimplement Core Reflection with Method Handle
  3. JDK-8277244

Release Note: JEP 416: Reimplement Core Reflection with Method Handles

    XMLWordPrintable

    Details

      Description

      JEP 416 reimplements core reflection with method handles. Code that depends upon highly implementation-specific and undocumented aspects of the existing implementation may be impacted and the issues that might arise include:
         - Code that inspects the internal generated reflection classes (i.e., subclasses of `MagicAccessorImpl`) no longer works and must be updated.
         - Code that attempts to break the encapsulation and change the value of the private final `modifiers` field of `Method`, `Field` and `Constructor` class to be different than that of the underlying member may cause a runtime error. Such code must be updated.

      To mitigate this compatibility risk, as a workaround you can enable the old implementation via `-Djdk.reflect.useDirectMethodHandle=false`. We will remove the old core reflection implementation in a future release. The `-Djdk.reflect.useDirectMethodHandle=false` workaround will stop working at that point.

        Attachments

          Activity

            People

            Assignee:
            mchung Mandy Chung
            Reporter:
            mchung Mandy Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: