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

Guy Steele guy.steele at oracle.com
Mon May 15 21:16:47 UTC 2023


Oh, right—thanks for this correction.

—Guy

On May 15, 2023, at 4:41 PM, Archie Cobbs <archie.cobbs at gmail.com> wrote:

On Mon, May 15, 2023 at 3:00 PM Guy Steele <guy.steele at oracle.com<mailto: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/7360d577/attachment.htm>


More information about the amber-dev mailing list