<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4"><font face="monospace">Small nits: <br>
- should add in buildTo() overload that mirrors build()
overloads<br>
- Not sure doing ClassFileImpl as a record is a win<br>
<br>
The rest of it seems nicely minimal.<br>
</font></font><br>
<div class="moz-cite-prefix">On 5/31/2023 5:55 AM, Adam Sotona
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CY4PR1001MB2150C0D5600CBBB59FA55FFD8C489@CY4PR1001MB2150.namprd10.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}div.WordSection1
{page:WordSection1;}</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">OK,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">I’ve updated the PR accordingly:<o:p></o:p></span></p>
<p class="MsoNormal"><a href="https://github.com/openjdk/jdk/pull/14180/files" title="https://github.com/openjdk/jdk/pull/14180/files" moz-do-not-send="true"><span style="color:#0078D7">https://github.com/openjdk/jdk/pull/14180/files</span></a><o:p></o:p></p>
<p class="MsoNormal"><a href="https://github.com/openjdk/jdk/blob/b7e42aa60e8ef6440ffe09577ab2de695dbc7513/src/java.base/share/classes/jdk/internal/classfile/Classfile.java" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk/blob/b7e42aa60e8ef6440ffe09577ab2de695dbc7513/src/java.base/share/classes/jdk/internal/classfile/Classfile.java</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">If there are no objections I’ll proceed to
update all doc and snippets to reflect the changes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US" lang="EN-US">Adam<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black"><a class="moz-txt-link-abbreviated" href="mailto:liangchenblue@gmail.com">liangchenblue@gmail.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:liangchenblue@gmail.com"><liangchenblue@gmail.com></a><br>
<b>Date: </b>Wednesday, 31 May 2023 3:48<br>
<b>To: </b>Brian Goetz <a class="moz-txt-link-rfc2396E" href="mailto:brian.goetz@oracle.com"><brian.goetz@oracle.com></a><br>
<b>Cc: </b>Adam Sotona <a class="moz-txt-link-rfc2396E" href="mailto:adam.sotona@oracle.com"><adam.sotona@oracle.com></a>,
classfile-api-dev <a class="moz-txt-link-rfc2396E" href="mailto:classfile-api-dev@openjdk.org"><classfile-api-dev@openjdk.org></a><br>
<b>Subject: </b>Re: [External] : Re: Planned features of
a classfile context object<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">I like
this withOptions() factory too. Looks more convenient than
the<br>
static of() parent-based forking; similar API designs
exist in<br>
ModuleLayer, but I think we can just keep the instance
version as we<br>
don't have multiple parents for a Classfile.<br>
<br>
On Wed, May 31, 2023 at 7:32 AM Brian Goetz
<a class="moz-txt-link-rfc2396E" href="mailto:brian.goetz@oracle.com"><brian.goetz@oracle.com></a> wrote:<br>
><br>
> I think having an instance method on Classfile that
produces a modified context:<br>
><br>
> Classfile withOptions(Option...)<br>
><br>
> would let you "refine" the options while keeping the
base options / cache config / etc.<br>
><br>
> I agree with Adam that moving all the "make me a
class" stuff in one place is a benefit.<br>
><br>
> On 5/29/2023 3:52 AM, Adam Sotona wrote:<br>
><br>
><br>
><br>
><br>
><br>
> From: <a class="moz-txt-link-abbreviated" href="mailto:liangchenblue@gmail.com">liangchenblue@gmail.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:liangchenblue@gmail.com"><liangchenblue@gmail.com></a><br>
> Date: Friday, 26 May 2023 23:53<br>
> To: Brian Goetz <a class="moz-txt-link-rfc2396E" href="mailto:brian.goetz@oracle.com"><brian.goetz@oracle.com></a><br>
> Cc: Adam Sotona <a class="moz-txt-link-rfc2396E" href="mailto:adam.sotona@oracle.com"><adam.sotona@oracle.com></a>,
classfile-api-dev <a class="moz-txt-link-rfc2396E" href="mailto:classfile-api-dev@openjdk.org"><classfile-api-dev@openjdk.org></a><br>
> Subject: [External] : Re: Planned features of a
classfile context object<br>
><br>
> The Classfile context in the patch looks somewhat
like a Classfile<br>
> element to me :) With that in mind, I wish we can
allow users to<br>
> transform/fork these immutable contexts, such as
skipping line numbers<br>
> for particular files, skip constantpool sharing for
select<br>
> transformations, etc. with the same code pattern in
Classfile<br>
> Transformers. Of course, a transformation will always
read the default<br>
> values of options if not explicitly set, and the
transformed context<br>
> will have dropped options replaced with their default
values.<br>
><br>
><br>
><br>
> I can imagine use for context factory method:<br>
><br>
> Classfile.Context.of(Classfile.Context parentContext,
Option… optionsOverride)<br>
><br>
> or after merge of Classfile.Context to Classfile:<br>
><br>
> Classfile.of(Classfile parentContext, Option…
optionsOverride)<br>
><br>
> Is it what you think about?<br>
><br>
><br>
><br>
> In addition, ClassModel.transform can probably be
kept, which means<br>
> using the creation context of the ClassModel to
transform this model,<br>
> if we make it clear that all models have their
lifetime bound to a<br>
> Classfile object.<br>
><br>
> I found the rule of all new classes created from the
context only as positive move.<br>
><br>
> Active class creation directly from ClassModel is
very confusing with respect to all the options that must
be defined before the model is created.<br>
><br>
> Explicit call of cc.transform(classModel, transform)
is more clear about what build/transform/write options are
applied.<br>
><br>
><br>
><br>
> Thanks,<br>
><br>
> Adam<br>
><br>
><o:p></o:p></span></p>
</div>
</div>
</blockquote>
<br>
</body>
</html>