Skip to content

fix: preserve interleaved named-list fill positions - #1298

Open
qiaolezi001 wants to merge 3 commits into
apache:mainfrom
qiaolezi001:fix/fesod-1295-interleaved-fill
Open

qiaolezi001 wants to merge 3 commits into
apache:mainfrom
qiaolezi001:fix/fesod-1295-interleaved-fill

Conversation

@qiaolezi001

@qiaolezi001 qiaolezi001 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Purpose of the pull request

Fixes #1295.

Alternating pages between named template lists can overwrite a lower list's existing records after an upper list inserts rows. Preserve each list's append position so every supplied record survives.

What's changed?

  • Use identity keys for the fill executor's per-cell position and style caches. Moving a template row no longer invalidates a cached AnalysisCell lookup; the public equality contract remains unchanged.
  • Track the last filled row and column separately and move affected positions with the worksheet rows. This preserves vertical append cursors and horizontal lists below an expanding section, while leaving other sheets alone.
  • Add real-workbook regressions for interleaved and ordered pages, filling lower lists first, horizontal lists, styles, row heights, scalar footers, and sheet isolation across XLS/XLSX and both memory modes.
  • Document interleaved pagination in the English and Chinese fill guides.

Validation on JDK 25 (project Java 8 target):

  • On the unmodified production code, 12 of the 20 new regression cases fail by overwriting previous records; the eight controls pass. All 20 pass after the fix, along with 19 existing fill tests.
  • ./mvnw clean package -pl fesod-common,fesod-shaded,fesod-sheet: 1,869 tests, zero failures, errors or skips. No test groups excluded; the normal Jazzer seed regressions ran, rather than a timed fuzz campaign.
  • The original issue's independent POI-reopen probe passes all eight ordered/interleaved format/memory combinations.
  • Repository-wide spotless:check, Hawkeye 7.0.0 check, and git diff --check pass.
  • All 135 website Markdown files pass the same markdownlint-cli2 0.24.0 / markdownlint 0.42.0 configuration used by Docs CI.

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.

Local validation used the JDK25 runtime and isolated Maven cache/temp directories. The remote JDK8/11/17/21/25 matrix, website build and timed fuzz campaign remain for CI or separate validation.

Generated-by: AI

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the changes preserving named-list append positions during interleaved template fills.

No open issues 🎉

What changed in this PR

Fixes #1295 by preserving each named list’s append position when interleaved template fills insert rows, preventing previously written records from being overwritten.

Changes:

  • Uses identity-based cell caches and shifts saved fill coordinates with rows on the same sheet.
  • Adds workbook regression tests covering fill order, horizontal lists, formatting, footers, and sheet isolation across XLS/XLSX and both memory modes.
  • Documents interleaved pagination and memory considerations in English and Chinese.
File Description
website/​i18n/​zh-cn/​docusaurus-plugin-content-docs/​current/​sheet/​fill/​fill.md Adds Chinese guidance for interleaved pagination.
website/​docs/​sheet/​fill/​fill.md Adds English guidance for interleaved pagination.
fesod-sheet/​src/​test/​java/​org/​apache/​fesod/​sheet/​style/​InterleavedFillTest.java Adds 20 parameterized workbook regression cases.
fesod-sheet/​src/​main/​java/​org/​apache/​fesod/​sheet/​write/​executor/​ExcelWriteFillExecutor.java Preserves cached positions and styles when template rows move.

Review effort: Balanced

This branch has not been deployed

No deployments
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] Interleaved named-list fills overwrite previously written records

3 participants