JEP proposed to target JDK 25: 513: Flexible Constructor Bodies

Mark Reinhold mark.reinhold at oracle.com
Wed May 7 13:33:07 UTC 2025


2025/4/29 16:41:35 -0400, mark.reinhold at oracle.com:
> The following JEP is proposed to target JDK 25:
> 
>   513: Flexible Constructor Bodies
>        https://openjdk.org/jeps/513
> 
>   Summary: In the body of a constructor, allow statements to appear
>   before an explicit constructor invocation, i.e., super(...) or
>   this(...).  Such statements cannot reference the object under
>   construction, but they can initialize its fields and perform other safe
>   computations.  This change allows many constructors to be expressed
>   more naturally.  It also allows fields to be initialized before they
>   become visible to other code in the class, such as methods called from
>   a superclass constructor, thereby improving safety.
> 
> Feedback on this proposal from JDK Project Committers and Reviewers [1]
> is more than welcome, as are reasoned objections.  If no such objections
> are raised by 21:00 UTC on Tuesday, 6 May, or if they’re raised and
> then satisfactorily answered, then per the JEP 2.0 process proposal [2]
> I’ll target this JEP to JDK 25.

Hearing no objections, I’ve targeted this JEP to JDK 25.

- Mark


More information about the jdk-dev mailing list