Skip to content

Propagate I/O failures from UnifiedDiffWriter - #234

Open
jakezwang wants to merge 2 commits into
java-diff-utils:masterfrom
jakezwang:fix/propagate-writer-errors
Open

jakezwang wants to merge 2 commits into
java-diff-utils:masterfrom
jakezwang:fix/propagate-writer-errors

Conversation

@jakezwang

Copy link
Copy Markdown

The Writer overload logs and swallows IOException, allowing a partially written diff to look successful to the caller.

Bridge the exception through the Consumer overload with UncheckedIOException, then rethrow the original IOException. Regression tests fail during header, body and trailer output, including newline writes, and verify that writing stops immediately.

Validation: mvn -B -ntp clean package passes on JDK 8 and 17, including formatting, Checkstyle, both modules and Javadoc (156 tests, 3 skipped). All four new cases fail before the fix.

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.

1 participant