RFR: 8378715: Use early field initialization for java.lang.invoke generated code

Chen Liang liach at openjdk.org
Thu Feb 26 20:20:09 UTC 2026


On Wed, 25 Feb 2026 21:27:08 GMT, Chen Liang <liach at openjdk.org> wrote:

> With Flexible Constructor Bodies, the preferred way to assign fields for objects is to assign before making a super call. These are all sites in the JDK code that can migrate to the new preferred pattern. This change also allows these fields to be later declared ACC_STRICT_INIT when strict fields JEP is integrated.

I checked the SystemModulesPlugin ones and did not find any that performs field initialization in the constructors. I think I have covered all cases. Thanks for the review! I ran tier 1-3 on linux-x64, all green, should be good to go.

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

PR Comment: https://git.openjdk.org/jdk/pull/29926#issuecomment-3968987029


More information about the core-libs-dev mailing list