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 <core-libs-dev-r...@openjdk.org> on behalf of Tesla Zhang 
<ice1000kot...@gmail.com>
Sent: Monday, February 3, 2025 2:16 PM
To: core-libs-dev@openjdk.org <core-libs-dev@openjdk.org>
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