Skip to content

fix: report outdated resource deletion failures - #560

Open
efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:codex/issue-517-check-resource-delete
Open

efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:codex/issue-517-check-resource-delete

Conversation

@efegokdemir

Copy link
Copy Markdown

Fixes #517

Summary

EarMojo now reports a warning when an outdated work-directory resource cannot be deleted, instead of silently continuing with stale output.

Changes

  • Check the return value of File.delete() in deleteOutdatedResources.
  • Log the affected resource when deletion fails.

Testing

  • JAVA_HOME=/opt/homebrew/Cellar/openjdk/27/libexec/openjdk.jdk/Contents/Home mvn -DskipITs -Dspotless.check.skip=true -Dspotless.apply.skip=true verify — passed; 48 tests passed.
  • git diff --check — passed.
  • Checkstyle and RAT passed; four existing Checkstyle findings were ignored by the repository configuration.
  • Integration tests were not run because -DskipITs was used for the focused local validation.

Notes

The change is intentionally limited to observability of deletion failures; it does not change the cleanup policy or mask the failure. AI assistance was used in preparing this change; I reviewed the modified code and test results.

  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004.

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
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.

Return value of File.delete() ignored in EarMojo

1 participant