Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8216558 Lookup.unreflectSetter(Field) fails to throw IllegalAccessException for static final field
  3. JDK-8221613

Release Note: Lookup.unreflectSetter(Field) Now Throws IllegalAccessException for Static Final Fields

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 13
    • 13
    • core-libs

      `java.lang.invoke.MethodHandles.Lookup::unreflectSetter` returns a `MethodHandle` giving write access to the given `Field` object. A `Field` object for a static final field does not have write access even if its accessible flag is true (i.e. `Field.setAccessibe(true)` has been called). In JDK 13, `Lookup::unreflectSetter` is fixed to throw `IllegalAccessException` if the given `Field` object is a static final field.

            afarley Adam Farley
            afarley Adam Farley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: