<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><hr id="zwchr"><div><blockquote style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: helvetica, arial, sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: helvetica, arial, sans-serif; font-size: 12pt;"><b>From: </b>"Chen Liang" <chen.<span class="Object" role="link" id="OBJ_PREFIX_DWT7771_ZmEmailObjectHandler">l.liang@oracle.com</span>><br><b>To: </b>"amber-spec-comments" <<span class="Object" role="link" id="OBJ_PREFIX_DWT7772_ZmEmailObjectHandler">amber-spec-comments@openjdk.org</span>><br><b>Cc: </b>"Remi Forax" <<span class="Object" role="link" id="OBJ_PREFIX_DWT7773_ZmEmailObjectHandler">forax@univ-mlv.fr</span>><br><b>Sent: </b><span class="Object" role="link" id="OBJ_PREFIX_DWT7774_com_zimbra_date">Tuesday, April 22</span>, 2025 5:21:22 PM<br><b>Subject: </b>Re: Draft Spec for Flexible Constructor Bodies (JEP 513)<br></blockquote></div><div><br></div><div><blockquote style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: helvetica, arial, sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: helvetica, arial, sans-serif; font-size: 12pt;"><div class="elementToProof" style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;" data-mce-style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;">Hi Rémi,</div><div class="elementToProof" style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;" data-mce-style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;">From valhalla development, we find that strict fields has a dependency on flexible constructor bodies, but flexible constructors are not tied down by strict fields (like strict fields aren't tied down by value objects). The early construction context allows Java programs to write code that can more smoothly transition to use strict fields without constructor code updates, so delivering flexible constructors early seems fine to me.</div></blockquote><div><br></div><div>From the development POV, i agree, but from the users perspective, we have a 3 phases change instead of 2, so it's harder to understand.</div><div><br></div><div>With flexible constructor bodies not in preview in Java 25:</div><div>phase 1: now, fields can not be initialized before a super() call</div><div>phase 2: fields are initialized before a super() call</div><div>phase 3: fields initialized before a super() call are strict</div><div><br></div><div>If flexible constructor bodies and strict fields are delivered at the same time:</div><div>phase 1: fields can not be initialized before a super() call</div><div>phase 2: fields can be initialized before super() and are strict</div><div><br></div><blockquote style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: helvetica, arial, sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: helvetica, arial, sans-serif; font-size: 12pt;"><div class="elementToProof" style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;" data-mce-style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;"><br></div><div class="elementToProof" style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;" data-mce-style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;">Regards,</div><div class="elementToProof" style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;" data-mce-style="font-family: 'calibri light', 'helvetica light', sans-serif; font-size: 12pt; color: #000000;">Chen Liang</div></blockquote><div><br></div><div>regards,</div><div>Rémi</div></div></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"></div><div data-marker="__QUOTED_TEXT__"><div></div>

<hr style="display:inline-block;width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amber-spec-observers <amber-spec-observers-retn@openjdk.org> on behalf of Remi Forax <forax@univ-mlv.fr><br><b>Sent:</b> Tuesday, April 22, 2025 9:59 AM<br><b>To:</b> Gavin Bierman <gavin.bierman@oracle.com><br><b>Cc:</b> amber-spec-experts <amber-spec-experts@openjdk.org><br><b>Subject:</b> Re: Draft Spec for Flexible Constructor Bodies (JEP 513)</font>
<div> </div>
</div>
<div>
<div style="font-family:arial,helvetica,sans-serif; font-size:12pt; color:#000000">
<div>Hello,</div>
<div>i'm not sure it's wise to have flexible constructor bodies to be out of preview.</div>
<div><br>
</div>
<div>There is a non trivial interaction with the introduction of strict fields and i am not sure those two should be separated, mostly because with strict fields, initializing a field before the call to super() change its semantics while with a flexible constructor
 body, one can already initialize the field before the call to super() without the semantics being changed.</div>
<div><br>
</div>
<div>But i'm sure i'm missing something ...</div>
<div><br>
</div>
<div>regards,</div>
<div>Rémi</div>
<div><br>
</div>
<hr id="x_zwchr">
<div>

<b>From: </b>"Gavin Bierman" <gavin.bierman@oracle.com><br>
<b>To: </b>"amber-spec-experts" <amber-spec-experts@openjdk.org><br>
<b>Sent: </b>Tuesday, April 22, 2025 3:48:31 PM<br>
<b>Subject: </b>Draft Spec for Flexible Constructor Bodies (JEP 513)<br>

</div>
<div>

<div>Dear experts,</div>
<div><br>
</div>
<div>The first draft of a spec covering JEP 513 (Flexible Constructor Bodies) is available at:</div>
<div><br>
</div>
<div><a href="https://cr.openjdk.org/~gbierman/jep513/latest/" target="_blank">https://cr.openjdk.org/~gbierman/jep513/latest/</a><br>
</div>
<div><br>
</div>
<div>Feel free to contact me directly or on this list with any comments/corrections.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Gavin</div>
<div><br>

<div>On 22 Apr 2025, at 13:02, Mark Reinhold <mark.reinhold@oracle.com> wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div>https://openjdk.org/jeps/513<br>
<br>
 Summary: In the body of a constructor, allow statements to appear<br>
 before an explicit constructor invocation, i.e., super(...) or<br>
 this(...).  Such statements cannot reference the object under<br>
 construction, but they can initialize its fields and perform other safe<br>
 computations.  This change allows many constructors to be expressed<br>
 more naturally.  It also allows fields to be initialized before they<br>
 become visible to other code in the class, such as methods called from<br>
 a superclass constructor, thereby improving safety.<br>
<br>
- Mark</div>
</div>

</div>
<br>
<br>

</div>
</div>
</div><br></div></div></body></html>