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

      [JEP 416](https://openjdk.java.net/jeps/416) reimplements core reflection with method handles. Code that depends upon highly implementation-specific and undocumented aspects of the existing implementation might be impacted. Issues that might arise include:
         - Code that inspects the internal generated reflection classes (such as, 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 from the underlying member might cause a runtime error. Such code must be updated.

      To mitigate this compatibility risk, you can enable the old implementation as a workaround by using `-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.

            mchung Mandy Chung (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: