RFR: 8280798: com.sun.jdi.ObjectReference::setValue spec should prohibit any final field modification

Chris Plummer cjplummer at openjdk.org
Tue Nov 22 22:52:20 UTC 2022


On Mon, 21 Nov 2022 22:58:54 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> com.sun.jdi.ObjectReference::setValue spec says that final static fields cannot be modified, but openjdk implementation throws IllegalArgumentException for any final fields (static or instance).
> 
> The fix updates the spec to prohibit any final field modification
> CSR: JDK-8281652

I also have to wonder about JIT behavior in this context (and this might be what the RMI warning is alluding to). What if the JIT sees a static final reference to an object with a final field. It probably generates code that references the value of the field rather than generating code that fetches from the field. If the field value changes, the JIT won't know and the existing code will continue to reference the old value.

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

PR: https://git.openjdk.org/jdk/pull/11279


More information about the serviceability-dev mailing list