<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I think there are something related to your problem - the multi-release jars do attempt to increase integration with different feature sets, and in fact, JLS requires class files that is compiled with --enable-preview but did not make use of any preview features
to have their minor version set to 0. So to control the scope, I think either using multiple compilation (multiple source sets) or checking the minor version in class files to determine the scope works.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As to your proposal - you see others have already listed a few arguments against it, and it is not the only way to address your problem. I hope the two existing solutions I listed above can somewhat alleviate the problem you face.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Chen</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amber-dev <amber-dev-retn@openjdk.org> on behalf of Goldmensch <pm@goldmensch.dev><br>
<b>Sent:</b> Monday, July 7, 2025 10:30 PM<br>
<b>To:</b> amber-dev@openjdk.org <amber-dev@openjdk.org><br>
<b>Subject:</b> Locally enabled preview features</font>
<div> </div>
</div>
<div>
<div dir="auto">
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
Hi folks!</div>
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
I’m wondering if the idea of “locally” enabled preview features came up yet. It would make it possible to enable certain preview features for a class, package or module by annotating it for example. Doing so would allow to use preview features much easier in
production to test them, while keeping the usage “scope” small so that changes can be easily integrated without risking the integrity of the codebase. Of course some feature like virtual threads (by the time they were in preview) could not be enabled in such
way due to the consequences to “non preview enabled code” but flexible constructor bodies, module import declarations, perhaps even scoped values and much more could be. </div>
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
<br style="">
</div>
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
Was this idea ever considered yet and if yes, what are the points against it?</div>
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
<br style="">
</div>
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
Best regards,</div>
<div dir="auto" style="font-style:normal; font-weight:400; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
Nick Hensel</div>
<br>
</div>
<div><br>
</div>
</div>
</body>
</html>