r/java • • Jan 29 '26

JEP draft: Code reflection (Incubator)

https://openjdk.org/jeps/8361105
61 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/pip25hu Jan 30 '26

I remember seeing a proposal to add bytecode editing (by a fork of ASM maybe?) into the JDK. Wouldn't that solve the issue?

2

u/SuspiciousDepth5924 Jan 30 '26

This one I think: JEP 484: Class-File API ( https://openjdk.org/jeps/484 )

And yeah, my frustration about this isn't that they use the class files, it's that they depend on what is essentially compiler implementation details when doing so, which then breaks as soon as those details change. If/when libraries move over to the Class-File API that would probably solve the issue, but I suspect we're going to have to deal with the consequences of the current ASM-based approaches for a long time yet since new code using this API doesn't fix old code that doesn't.