Skip to content

Fix StackOverflow when exporting POJOs with custom converters#899

Open
utafrali wants to merge 1 commit intoapache:mainfrom
utafrali:fix/issue-889-bug-pojo-export-with-custom-converter-st
Open

Fix StackOverflow when exporting POJOs with custom converters#899
utafrali wants to merge 1 commit intoapache:mainfrom
utafrali:fix/issue-889-bug-pojo-export-with-custom-converter-st

Conversation

@utafrali
Copy link
Copy Markdown
Contributor

Purpose of the pull request

Closes #889

Fixes the stack overflow error that happens when exporting POJOs with custom converters.

What's changed?

The issue was @EqualsAndHashCode trying to hash the entire object graph, including parent references. Since WriteSheetHolder has parentWriteWorkbookHolder and WriteTableHolder has parentWriteSheetHolder, these circular references caused infinite recursion during equals/hashcode generation.

Excluded those parent fields from the @EqualsAndHashCode annotation. This breaks the circular dependency without affecting the equality logic for these holders. Also added tests for the ZonedDateTime converter to make sure custom converters work properly with the fix.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Exclude circular reference fields from @EqualsAndHashCode to prevent infinite recursion during POJO export. Closes apache#889
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

Successfully merging this pull request may close these issues.

[Bug]POJO Export with custom converter StackOverflow Repro

1 participant