RFR: javac should not place initializers of null restricted fields before the super invocation [v5]
Chen Liang
liach at openjdk.org
Fri Jan 30 23:02:10 UTC 2026
On Fri, 30 Jan 2026 22:56:44 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> javac is automatically placing the initializers of null restricted fields before the super invocation. This is incorrect, null restricted fields are not strict and those initializers should be placed after the super. But javac will check that null restricted fields have been initialized before a super invocation. This implies that null restricted fields should not have initializers and users should manually initialize them in all the constructors and before explicit super invocations.
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>
> addressing review comments
Good, if we want initializer back we can tweak ownerIsValueOrRecord later.
-------------
Marked as reviewed by liach (Committer).
PR Review: https://git.openjdk.org/valhalla/pull/1990#pullrequestreview-3730831091
More information about the valhalla-dev
mailing list