Stack Map frames dropped when copying full method

Rafael Winterhalter rafael.wth at gmail.com
Thu Aug 22 15:35:13 UTC 2024


Hello,

I stumbled over something I did not expect and I am wondering if this
behaviour is intended. I create a class where I create a method. I add the
stack map frames manually to avoid resolving super classes, since I already
have the meta data. For this, I set
ClassFile.StackMapsOption.DROP_STACK_MAPS. For the same class, I read a
method from another class, take the MethodModel and add it. In the
resulting class, the stack map frames for the copied method are dropped,
too. This I find surprising, because I only intended to avoid computation
for stack map frames that were not there from before. I did not expect the
frames to be dropped if I copied a full method model including all of its
attributes.

What do you think here? Is there a way to retain the stack map table
attribute for method models that are copied over while being able to
resolve frames manually for new methods?

Thanks! Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20240822/329f3886/attachment.htm>


More information about the classfile-api-dev mailing list