Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize MapperGenerator class so that there will be no method code length limit #393

Open
Rayti opened this issue Aug 17, 2022 · 0 comments

Comments

@Rayti
Copy link

Rayti commented Aug 17, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant