raphw / byte-buddy

Runtime code generation for the Java virtual machine.
https://bytebuddy.net
Apache License 2.0
6.29k stars 807 forks source link

Can I bypass the parameter restriction of the parent class constructor and construct a subclass? #1559

Closed 1057105012 closed 11 months ago

1057105012 commented 1 year ago

The purpose of this scenario is to construct a more compatible proxy structure, but I don't care what the constructor parameters of the parent class are. I just need to successfully build a subclass. In addition to allocateInstance provided by unsafe, there are other way, can I use bytebuddy to construct such a class? The problem I'm encountering now is that I'm blocked by the parameterized constructor of the parent class.