[lworld] RFR: 8349945: Implement strict static fields (proposed JVM feature) [v3]

Dan Heidinga heidinga at openjdk.org
Mon May 26 15:37:04 UTC 2025


On Mon, 26 May 2025 15:25:28 GMT, Chen Liang <liach at openjdk.org> wrote:

> I think reflective write for static final is already impossible - at least that is what I know about Method Handles and core reflection. So we probably just need to care about reflective reads.

Let's confirm that.  It used to be possible (and maybe still is) to use `setAccessible` to allow reflective writes to finals.  MHs won't unallow static final setters unless they come through the MethodHandles::unreflect door with an `accessible` reflective field

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/1465#issuecomment-2910119235


More information about the valhalla-dev mailing list