When compiling structs with lots and lots of function pointer fields, jextract can sometime end up with sources which cannot be compiled, due to classfile limitations (constant pool, or code size).
The problem is caused by the fact that a functional interface reuses the "nearest" constant builder - so, if a functional interface is defined inside a struct, the struct class itself is used as holder for the upcall constants.
While this behavior was meant to minimize the generation of constant classes, it is easy to see how it would fail to scale for very large structs (and also, how it would defeat the initialization performance guarantees provided by jextract).
The problem is caused by the fact that a functional interface reuses the "nearest" constant builder - so, if a functional interface is defined inside a struct, the struct class itself is used as holder for the upcall constants.
While this behavior was meant to minimize the generation of constant classes, it is easy to see how it would fail to scale for very large structs (and also, how it would defeat the initialization performance guarantees provided by jextract).