Hi Tesla,
In short, you can't. To write a local variable, the only way provided by the 
ClassFile API is to create a java.lang.classfile.instruction.LocalVariable, and 
send it to CodeBuilder::with, or just calling CodeBuilder::localVariable. The 
LocalVariableInfo interface exists to faithfully represent the contents of a 
LocalVariableTable attribute for class file parsing.

Regards,
Chen Liang
________________________________
From: core-libs-dev <[email protected]> on behalf of Tesla Zhang 
<[email protected]>
Sent: Monday, February 3, 2025 2:16 PM
To: [email protected] <[email protected]>
Subject: How do I create a `LocalVariableInfo`?

I'm using classfile. It seems that the interface is sealed and either 
implementations are not exported.

Best,
Tesla

Reply via email to