adding an interface to a class
Daniel Jarabek
jarabekit at gmail.com
Fri Apr 11 00:07:30 UTC 2025
I think you mean utf8Entry instead of "uft8Entry".
-DJ
On 4/10/25 20:05, Mark Roberts wrote:
> I must be missing something. This works:
>
> ClassDesc cd = ClassDesc.of(name); // (name is string containing
> binary name)
>
> ClassEntry ce = poolBuilder.classEntry(cd);
>
> But this gets a compile error:
>
> Utf8Entry ue = poolBuilder.uft8Entry(name); // (name is string
> containing internal form)
>
> daikon/dcomp/ClassGen24.java:103: error: cannot find symbol
>
> Utf8Entry ue = poolBuilder.uft8Entry(name);
>
> ^
>
> symbol: method uft8Entry(String)
>
> location: variable poolBuilder of type ConstantPoolBuilder
>
> ClassEntry ce = poolBuilder.classEntry(ue);
>
> Thank you,
>
> Mark
>
> *From:* Brian Goetz <brian.goetz at oracle.com
> <mailto:brian.goetz at oracle.com>>
> *Sent:* Wednesday, April 2, 2025 12:25 PM
> *To:* Mark Roberts <markro at cs.washington.edu
> <mailto:markro at cs.washington.edu>>; Chen Liang <chen.l.liang at oracle.com
> <mailto:chen.l.liang at oracle.com>>; classfile-api-dev at openjdk.org
> <mailto:classfile-api-dev at openjdk.org>
> *Subject:* Re: adding an interface to a class
>
> Correct. (For bonus points, you should also check to make sure it is
> not already in the list of implemented interfaces.)
>
> On 4/2/2025 3:12 PM, Mark Roberts wrote:
>
> 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?
>
> Thank you,
>
> Mark
>
More information about the classfile-api-dev
mailing list