JDK-8221613 : Release Note: Lookup.unreflectSetter(Field) Now Throws IllegalAccessException for Static Final Fields
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-03-28
  • Updated: 2019-08-09
  • Resolved: 2019-06-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13Resolved
Description
`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.
Comments
I will make a note of those points for the next Release Note. Thanks for the review. :) Actually, it may be worth putting this info in the CSR FAQ (what a release note is, how to make one, etc). Will send an email to the website list.
29-03-2019

[~afarley] A release note requires review too. I revised the wording. No need to mention the changeset since the release note will have a link to the JBS issue when published.
28-03-2019