<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
To clarify, the spec is being revised to drop "<font face="Courier New" size="2">import static java.lang.StringTemplate.RAW;”.</font>
<div><br>
<blockquote type="cite">
<div>On Nov 14, 2023, at 10:31 AM, Remi Forax <forax@univ-mlv.fr> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div>
<div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;">
<div>For me,<br>
</div>
<div>RAW does not need to be imported by default, it's uses is not that frequent, it's more like FMT than STR.<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>regards,<br data-mce-bogus="1">
</div>
<div>Rémi<br data-mce-bogus="1">
</div>
<div><br>
</div>
<hr id="zwchr" data-marker="__DIVIDER__">
<div data-marker="__HEADERS__">
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;">
<b>From: </b>"Jim Laskey" <james.laskey@oracle.com><br>
<b>To: </b>"Ella Ananeva" <ella.ananeva@oracle.com><br>
<b>Cc: </b>"amber-dev" <amber-dev@openjdk.org><br>
<b>Sent: </b>Tuesday, November 14, 2023 2:38:59 PM<br>
<b>Subject: </b>Re: java.lang.StringTemplate.RAW is not implicitly imported?<br>
</blockquote>
</div>
<div data-marker="__QUOTED_TEXT__">
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;">
Thank you for pointing that out. We will revise.<br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote>
<div>On Nov 13, 2023, at 5:03 PM, Ella Ananeva <ella.ananeva@oracle.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Hi team,</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Reading the JEP 459 spec, I see this:</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">The static members<span class="Apple-converted-space"> </span><code style="font-family: "Courier New";"><span style="font-size: 10pt;">STR</span></code><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><code style="font-family: "Courier New";"><span style="font-size: 10pt;">RAW</span></code><span class="Apple-converted-space"> </span>declared
in the predefined interface<span class="Apple-converted-space"> </span><code style="font-family: "Courier New";"><span style="font-size: 10pt;">StringTemplate</span></code>, as if the declarations<span class="Apple-converted-space"> </span><code style="font-family: "Courier New";"><span style="font-size: 10pt;">import
static java.lang.StringTemplate.STR;</span></code><span class="Apple-converted-space"> </span>and<code style="font-family: "Courier New";"><span style="font-size: 10pt;">import static java.lang.StringTemplate.RAW;</span></code><span class="Apple-converted-space"> </span>appeared
at the beginning of each compilation unit immediately after any<span class="Apple-converted-space"> </span><code style="font-family: "Courier New";"><span style="font-size: 10pt;">package</span></code><span class="Apple-converted-space"> </span>declaration.</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">As a result, the names of all <strong><span style="font-family: Calibri, sans-serif;">implicitly imported</span></strong><span class="Apple-converted-space"> </span> <strong><span style="font-family: Calibri, sans-serif;">classes,
interfaces and static fields</span></strong><span class="Apple-converted-space"> </span>are available as simple names in every compilation unit.</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">So, I assume this should work:</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background: white;">
<span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);">package<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: "Courier New";">test</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);">;<br>
<br>
</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);">public class<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: "Courier New";">Example<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);">{<br>
<br>
<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);">public static void<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 98, 122);">main</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);">(</span><span style="font-size: 10pt; font-family: "Courier New";">String<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);">argv[])
{</span></div>
<pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: "Courier New"; background: white;"><span style="color: rgb(0, 51, 179);"> int </span><span style="">a </span><span style="color: rgb(8, 8, 8);">= </span><span style="color: rgb(23, 80, 235);">1</span><span style="color: rgb(8, 8, 8);">;<br> </span><span style="">StringTemplate raw </span><span style="color: rgb(8, 8, 8);">= RAW.</span><span style="color: rgb(6, 125, 23);">"<span style="background: rgb(255, 204, 204);">\{</span>a}"</span><span style="color: rgb(8, 8, 8);">;<br> }<br>}</span></pre>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-family: "Courier New";"> </span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">But I get<span class="Apple-converted-space"> </span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="s1">java:7: error: cannot find symbol</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="apple-converted-space"> <span class="Apple-converted-space"> </span></span><span class="s1">StringTemplate raw = RAW."\{a + b}";</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="apple-converted-space"> <span class="Apple-converted-space"> </span></span><span class="s1">^</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="apple-converted-space"> <span class="Apple-converted-space"> </span></span><span class="s1">symbol:<span class="Apple-converted-space"> </span></span><span class="apple-converted-space"> <span class="Apple-converted-space"> </span></span><span class="s1">variable
RAW</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="apple-converted-space"> <span class="Apple-converted-space"> </span></span><span class="s1">location: class Example</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="s1">java --version</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="s1">java 22-internal 2024-03-19</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="s1">Java(TM) SE Runtime Environment (build 22-internal-2023-11-03-1839366.james.laskey.open)</span></div>
<div style="margin: 0in; font-size: 8.5pt; font-family: Menlo;"><span class="s1">Java HotSpot(TM) 64-Bit Server VM (build 22-internal-2023-11-03-1839366.james.laskey.open, mixed mode, sharing)</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">This code compiles if I add a static import<span class="Apple-converted-space"> </span><code style="font-family: "Courier New";"><span style="font-size: 10pt;">import static java.lang.StringTemplate.RAW;</span></code></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">STR is available through static import, so it’s only RAW that causes issues.</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Could it be a bug in JDK?</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Thank you,</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Ella Ananeva</div>
</div>
</div>
</blockquote>
</div>
<br>
<br>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</body>
</html>