JDK 26 introduces warnings when final fields are mutated through Java's reflection API, as part of a broader effort to enforce integrity by default. The change is driven by JEP 500 and follows a pattern of Java progressively restricting capabilities that undermine language guarantees. Two new command-line options are introduced: `--enable-final-field-mutation` for permanent per-module permission, and `--illegal-final-field-mutation` for transitional control. Currently a warning, this will become an error in a future release. Library and framework maintainers are urged to stop relying on reflective final field mutation and adopt alternative approaches.
Table of contents
Reflective Mutation of Final FieldsIntegrity by DefaultNew Warnings and (Soon) ErrorsAdapting to Immutable Final FieldsSort: