Optimize MapperGenerator class so that there will be no method code length limit
Opened this issue · 0 comments
Rayti commented
Hello! Recently I encountered a problem with defining mapping for large legacy classes with many nested fields.
Class MapperGenerator
in method
private Set<FieldMap> addMapMethod(SourceCodeContext code, boolean aToB, ClassMap<?, ?> classMap, StringBuilder logDetails)
combines all class map field mappings into one method. So when there are many field mappings and fields have long names there might occur an "Method code too large exception" during initializing generated mapping classes at runtime. The standard limit in JDK for method length is 64k.
I looked up one of the generated mapping class in my code and it's method has almost 7k lines :).
Is there any workaround for this problem?