-
I am wondering if this library offers a way to validate issues in such a way that prevents VerifyError. For example, I can write a custom Implementation that prints "hello world" but does not include VerifyError is problematic because it does not contain any help messages. Therefore, it seems desirable to fail faster and with more helpful messages. My understanding is that one way to have this level of safety is to use ByteBuddy's existing Implementation types. However, I don't know how to validate custom Implementation types. In theory, it seems like it could be a feature. All that would be needed would be to replicate some of the JVM's verification logic and throw more helpful error messages. And it doesn't neccesarily have to catch all potential VerifyErrors, even catching some would be valuable. But I do not know if such feature exists. To clarify, if the JVM's VerifyError contained helpful messages than I don't think this would be a significant issue. It's the lack of accompanying message with VerifyError that really makes it such a problem for me. Its not really important how "fast" an error is thrown, but more about how descriptive it is. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What I am imagining is that
And throw descriptive errors. Does a feature such as this exist? |
Beta Was this translation helpful? Give feedback.
-
Answering my own question based on what I discovered. ASM has some code in |
Beta Was this translation helpful? Give feedback.
Answering my own question based on what I discovered. ASM has some code in
CheckClassAdapter
that helped. I couldn't call the ASM methods directly unfortunately because it has some strange logic regarding when to throw errors and print output, but I copied some of the code and adapted it to get a nice verifyer that prints helpful errors before a potential VerifyHerror