<div dir="ltr"><div>Hello!</div><div><br></div><div>It's been a while since I last tried, but I now managed to implement both a JDK-based ClassReader and ClassWriter for ASM. This seems to work really well for a range of tests that I did as it allows me to avoid major rewrites of ASM-based code while still having forward-compatibility as long as there are no new language constructs as the JDK bundles parser and serializer.</div><div><br></div><div>The code can be found here: <a href="https://github.com/raphw/asm-jdk-bridge">https://github.com/raphw/asm-jdk-bridge</a></div><div><br></div><div>A few notes and questions I have:</div><div><br></div><div>1. The OpenJDK API supports CharacterRangeTable which is a non-standard attribute that is not described in the specification. By introducing it to the official API, isn't the attribute in a way formalized? Is there a plan to standardize the attribute?</div><div><br></div><div>2. One thing that cannot be mapped directly from OpenJDK to ASM are line numbers. In ASM, they can be added later using a Label. In OpenJDK they have to be visited at "the right time". Using labels is otherwise common for other attributes, both in ASM and OpenJDK, but line numbers are the exception. Is there a reason for this?</div><div><br></div><div>3. It would be nice if there was a way to flag what attributes should be treated as UnknownAttributes. Right now, I retain UnknownAttributes as they are. But if a future release of the OpenJDK promotes an UnknownAttribute to a known one, I might miss it when copying them over as raw arrays.</div><div><br></div><div>4. I take it so that there are no plans to add support for manually defining StackMapFrame and method sizes? Sometimes, the OpenJDK erases information, for example if a local variable is never assigned a value, it will simply be treated as "N" value. This is not a big issue, but it can make slight transformations that can have very subtle implications when for example writing Java agents, so I would still hope for an option for this to be used by advanced users.</div><div><br></div><div>Thanks! Rafael<br></div></div>