<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=utf-8">
<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;}
/* Style Definitions */
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;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-CZ" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">OK,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language: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"><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">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 lang="EN-US" style="font-size:11.0pt;mso-fareast-language: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 lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language: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">liangchenblue@gmail.com <liangchenblue@gmail.com><br>
<b>Date: </b>Wednesday, 31 May 2023 3:48<br>
<b>To: </b>Brian Goetz <brian.goetz@oracle.com><br>
<b>Cc: </b>Adam Sotona <adam.sotona@oracle.com>, classfile-api-dev <classfile-api-dev@openjdk.org><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 <brian.goetz@oracle.com> 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: liangchenblue@gmail.com <liangchenblue@gmail.com><br>
> Date: Friday, 26 May 2023 23:53<br>
> To: Brian Goetz <brian.goetz@oracle.com><br>
> Cc: Adam Sotona <adam.sotona@oracle.com>, classfile-api-dev <classfile-api-dev@openjdk.org><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>
</body>
</html>