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

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Delivered
    • Priority: P4
    • 13
    • Affects Version/s: 13
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: