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

David Holmes dholmes at openjdk.org
Tue Nov 22 21:52:24 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

So changing the spec would make Eclipse non-compliant. Perhaps to bring the spec and implementation in-line we have to make the implementation behaviour allowable by the spec but not required - that is what we often do in other areas (e.g. JNI spec - my personal point of experience).

But I remain surprised/perplexed that a debugger would not be allowed to change a final field. Can't we still change final fields via reflection anyway? (I know the constraints have been tightening in that area.)

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

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


More information about the serviceability-dev mailing list