<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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);">
Might be that you have a class that's not java.lang.String but also has this simple name of String. Note that bere is not a technical support channel, and if you are reporting an issue, you should provide steps of reproduction or problem/code analysis.</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> Mark Roberts <markro@cs.washington.edu><br>
<b>Sent:</b> Thursday, April 10, 2025 7:05 PM<br>
<b>To:</b> classfile-api-dev@openjdk.org <classfile-api-dev@openjdk.org><br>
<b>Cc:</b> Brian Goetz <brian.goetz@oracle.com>; Chen Liang <chen.l.liang@oracle.com><br>
<b>Subject:</b> [External] : RE: adding an interface to a class</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
span.x_EmailStyle19
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal">I must be missing something.  This works:</p>
<p class="x_MsoNormal">      ClassDesc cd = ClassDesc.of(name); // (name is string containing binary name)</p>
<p class="x_MsoNormal">      ClassEntry ce = poolBuilder.classEntry(cd);</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">But this gets a compile error:</p>
<p class="x_MsoNormal">      Utf8Entry ue = poolBuilder.uft8Entry(name); // (name is string containing internal form)</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">daikon/dcomp/ClassGen24.java:103: error: cannot find symbol</p>
<p class="x_MsoNormal">    Utf8Entry ue = poolBuilder.uft8Entry(name);</p>
<p class="x_MsoNormal">                                                   ^</p>
<p class="x_MsoNormal">  symbol:   method uft8Entry(String)</p>
<p class="x_MsoNormal">  location: variable poolBuilder of type ConstantPoolBuilder</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">      ClassEntry ce = poolBuilder.classEntry(ue);</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Thank you,</p>
<p class="x_MsoNormal">Mark</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
<div>
<div style="border:none; border-top:solid #e1e1e1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_MsoNormal"><b>From:</b> Brian Goetz <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>>
<br>
<b>Sent:</b> Wednesday, April 2, 2025 12:25 PM<br>
<b>To:</b> Mark Roberts <<a href="mailto:markro@cs.washington.edu">markro@cs.washington.edu</a>>; Chen Liang <<a href="mailto:chen.l.liang@oracle.com">chen.l.liang@oracle.com</a>>;
<a href="mailto:classfile-api-dev@openjdk.org">classfile-api-dev@openjdk.org</a><br>
<b>Subject:</b> Re: adding an interface to a class</p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:13.5pt; font-family:"Courier New"">Correct.  (For bonus points, you should also check to make sure it is not already in the list of implemented interfaces.)</span></p>
<div>
<p class="x_MsoNormal">On 4/2/2025 3:12 PM, Mark Roberts wrote:</p>
</div>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<p class="x_MsoNormal">I might be missing something, but I see only a method to set all the interfaces of a class.  So to add an interface I have to get the current list of interfaces, add mine to it and then reset the entire list.  Is that correct?</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Thank you,</p>
<p class="x_MsoNormal">Mark</p>
<p class="x_MsoNormal"> </p>
</blockquote>
<p class="x_MsoNormal"> </p>
</div>
</div>
</body>
</html>