[Resend] Draft Spec for Statements before Super() (JEP 447)

Archie Cobbs archie.cobbs at gmail.com
Mon May 15 20:41:56 UTC 2023


On Mon, May 15, 2023 at 3:00 PM Guy Steele <guy.steele at oracle.com> wrote:

> 12.5 In the list of six steps for processing a constructor, the logic is a
> bit difficult to follow because of nonparallelism, recapitulation, and a
> mixture of explicit “goto” instructions with drop-through. I suggest this
> refactored structure:
>

That's a nice cleanup - thanks.

It looks like step 4 is redundant:


> 1.  Assign the arguments for the constructor to newly created parameter
> variables for this constructor invocation.
>
> 2.  If this constructor does not contain an explicit constructor
> invocation (8.8.7.1), go to step 4; otherwise, continue with step 3.
>
> 3.  Execute the BlockStatements, if any, of the prologue of the
> constructor body. If execution of any statement completes abruptly, then
> execution of the constructor completes abruptly for the same reason;
> otherwise, continue with step 4.
>
> 4.  If this constructor does not contain an explicit constructor
> invocation (8.8.7.1), go to step 6; otherwise, continue with step 5.
>

So step 4 can be removed, and step 2 can "goto step 6" (of course once step
4 is removed, steps 5+ get renumbered so that change ultimately becomes
"goto step 5").

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230515/2a8e8bd5/attachment-0001.htm>


More information about the amber-dev mailing list