Skip to content

fix: reject same template and output file - #1163

Open
Aias00 wants to merge 1 commit into
apache:mainfrom
Aias00:fix/template-same-file-truncate-1153
Open

Aias00 wants to merge 1 commit into
apache:mainfrom
Aias00:fix/template-same-file-truncate-1153

Conversation

@Aias00

@Aias00 Aias00 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closed: #1153

Summary

  • reject file-based writes where template and output resolve to the same file before opening the output stream
  • add regression coverage that original template bytes remain unchanged and distinct files still work

Verification

  • ./mvnw -pl fesod-sheet -Dmaven.test.skip=false -DskipTests=false -Dtest=WriteWorkbookHolderOutputStreamTest#writeRejectsSameTemplateAndOutputFileWithoutTruncatingTemplate+writeAllowsDistinctTemplateAndOutputFiles test
  • ./mvnw -pl fesod-sheet spotless:check

Signed-off-by: liuhy <liuhongyu@apache.org>
@Aias00
Aias00 force-pushed the fix/template-same-file-truncate-1153 branch from 205d865 to eefaa09 Compare September 30, 2026 07:03

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] Using the same file as template and output truncates the template

1 participant