Classfile API proposal to integrate basic print functionality directly to ClassModel and MethodModel

Brian Goetz brian.goetz at oracle.com
Thu Jul 21 11:38:03 UTC 2022


Mechanics are there in the form of buffered builders, but they are not exposed in the easy way right now. This is something to figure out.

Sent from my iPad

On Jul 21, 2022, at 7:22 AM, Michael van Acken <michael.van.acken at gmail.com> wrote:


Related but geared towards the builder side of things:

Is there a way to print out a trace of parts fed to CodeBuilder instances?

Just this morning I had Classfile die on me because of a stack underflow,
and it was quite hard to find out which parts were missing from the Code
attribute.  And that with a Code totalling just 5 instructions...

If there would have been bytes output, then I could have inspected the
situation with javap.  But if I mess up and pass inconsistent data to
CodeBuilder, causing it to throw instead of producing a byte array, then
I have an observability gap.

-- mva

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20220721/4b0862b8/attachment.htm>


More information about the classfile-api-dev mailing list