<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Iosevka Fixed SS16";
        panose-1:2 0 5 9 3 0 0 0 0 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Iosevka Fixed SS16";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">+1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">I would like to put forth an opinion that we should NOT use non-comprehensive switch expressions over enums, as they introduce a major incompatibility when evolving that enum
 (i.e. when adding new values).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">Consider this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">enum E { A, B }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">E e;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">switch(e) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">case A -> "a";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">case B -> "b";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">evolving to<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">enum A { A, B, C };<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">previously comprehensive switch expression explodes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">-andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Kevin Rushforth <kevin.rushforth@oracle.com><br>
<b>Date: </b>Friday, February 16, 2024 at 14:12<br>
<b>To: </b>openjfx-dev <openjfx-dev@openjdk.org><br>
<b>Subject: </b>Proposal: Bump minimum JDK version for JavaFX 23 to JDK 21<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">All,<br>
<br>
Even though we build JavaFX binaries with JDK 21 as the boot JDK, the <br>
latest version of JavaFX still runs with JDK 17, although it isn't <br>
tested with older JDK versions. In order for JavaFX to be able to use <br>
newer JDK features, such as code snippets (in API docs), record <br>
patterns, pattern matching for switch statements, and so forth, we need <br>
to increase the minimum version of the JDK that can run the latest <br>
JavaFX. Additionally, there is an ongoing cost to keeping JavaFX <br>
buildable and runnable on older versions of Java, and very little reason <br>
to continue to do so.<br>
<br>
A question was raised [1] as to whether we should go even further and, <br>
once JDK 22 is released, jump straight to JDK 22 as a  minimum. While we <br>
could do that, I feel that there isn't sufficient justification for this <br>
at this time, although we could reconsider for next release.<br>
<br>
To this end, I propose to bump the minimum version of the JDK needed to <br>
run JavaFX 23 to JDK 21. I filed JDK-8321603 [2] to track this and <br>
prepared PR  #1370 [3] (I've moved the PR back to Draft, pending this <br>
discussion). This will not affect update releases of earlier versions of <br>
JavaFX (e.g., JavaFX 21.0.NN or JavaFX 17.0.NN), which will continue to <br>
run with the same minimum JDK that they run on today.<br>
<br>
As a reminder, we only assure that JavaFX NN will run with JDK NN-1 or <br>
later, although in practice, we don't bump the minimum required JDK <br>
version without a good reason. For example, while JavaFX 22 is built <br>
using JDK 21 as the boot JDK, it produces class files that will run with <br>
JDK 17, using "--release 17". The proposed change discussed here would <br>
update that in JavaFX 23 to "--release 21".<br>
<br>
NOTE: this will not be an invitation to do wholesale refactoring of <br>
existing classes or methods to use newer language features (e.g., a PR <br>
that refactors existing switch statements and switch expressions into <br>
pattern-matching switch expressions would not be welcome). Rather, this <br>
can be seen as enabling judicious use of new features in new code, much <br>
as we did when we started allowing the use of "var", records, and <br>
pattern-matching instanceof.<br>
<br>
Comments are welcome.<br>
<br>
-- Kevin<br>
<br>
[1] <a href="https://mail.openjdk.org/pipermail/openjfx-dev/2023-December/044081.html">
https://mail.openjdk.org/pipermail/openjfx-dev/2023-December/044081.html</a><br>
[2] <a href="https://bugs.openjdk.org/browse/JDK-8321603">https://bugs.openjdk.org/browse/JDK-8321603</a><br>
[3] <a href="https://github.com/openjdk/jfx/pull/1370">https://github.com/openjdk/jfx/pull/1370</a><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>