<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Goldmensch" <pm@goldmensch.dev><br><b>To: </b>"amber-dev" <amber-dev@openjdk.org><br><b>Sent: </b>Tuesday, July 8, 2025 5:30:35 AM<br><b>Subject: </b>Locally enabled preview features<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; ; ; ; ; ;">Was this idea ever considered yet and if yes, what are the points against it?</div></div></blockquote><div><br></div><div>It was considered and rejected.</div><div><br data-mce-bogus="1"></div><div>The preview mechanism has to be rough / raw, so it conveys the fact that there is no guarantee of backward compatibility from a release to the next one.</div><div><br data-mce-bogus="1"></div><div>Also, the implementation of a feature may change from one version to the next, a feature can be implemented as only a javac change in one version and as a bytecode change  in the next version, so the notion of "scope" of a feature does not really exist.</div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 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; ; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; ; ; ; ; ;">Nick Hensel</div></div></blockquote><div><br></div><div>regards,</div><div>Rémi</div><div><br data-mce-bogus="1"></div></div></div></body></html>