<div dir="ltr"><div dir="ltr">On Fri, Jan 27, 2023 at 8:19 PM John Rose <<a href="mailto:john.r.rose@oracle.com">john.r.rose@oracle.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div><div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 26 Jan 2023, at 11:19, Maurizio Cimadamore wrote:</p>
</div><div style="white-space:normal"><blockquote style="margin:0px 0px 5px;padding-left:5px;border-left:2px solid rgb(119,119,119);color:rgb(119,119,119)"><p dir="auto">On 26/01/2023 18:16, Archie Cobbs wrote:</p>
<blockquote style="margin:0px 0px 5px;padding-left:5px;border-left:2px solid rgb(153,153,153);color:rgb(153,153,153)"><p dir="auto">Yes, but for this to happen the subclass would have to be in effect intentionally subverting the superclass constructor.</p>
<p dir="auto">In other words, a problem like you describe can't suddenly just start happening "by accident" just because this new feature exists...</p>
</blockquote><p dir="auto">Well, you could have a subclass (in some client jar) which "subverts" as you say, some superclass in a library. Perhaps the library was not prepared for that kind of behavior, and now there's a new bug.</p>
<p dir="auto">IMHO, we should try to stay well clear of that can of worms. It's not like we have to open it now either - the other things you propose are 100% non-controversial.</p>
</blockquote></div>
<div style="white-space:normal">
<p dir="auto">Just to be clear:</p>
<p dir="auto">Early assignment to a <i>super</i> field is never possible</p></div></div></div></blockquote><div><br></div>Ah, you are correct. I was missing this nuance and incorrectly thinking it was allowed to write to *any* field in the object prior to super().</div><div class="gmail_quote"><br></div><div class="gmail_quote">JVMS §<a href="http://4.10.2.4">4.10.2.4</a>:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote">Before that method invokes
                     another instance initialization method of <code class="gmail-literal">myClass</code>
                     or its direct superclass on <code class="gmail-literal">this</code>, the only operation the method can
                     perform on <code class="gmail-literal">this</code> is assigning fields <b>declared
                     within <code class="gmail-literal">myClass</code></b>.
                  </div></blockquote><div class="gmail_quote"><br></div><div class="gmail_quote">So that whole discussion about writing to superclass fields prior to super() is moot.</div><div class="gmail_quote"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote">I must be missing your point here Maurizio…  There is<br>
some corner case you are concerned with but I can’t see<br>
where the danger is.</div></blockquote><div class="gmail_quote"><br></div><div class="gmail_quote">Yes... and now me too :)<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">-Archie<br clear="all"></div><br>-- <br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>