ppkarwasz commented on PR #789:
URL: https://github.com/apache/commons-io/pull/789#issuecomment-3346176993

   @garydgregory,
   
   Since making `AbstractOrigin` `Closeable` turned out not to make sense, I’ve 
repurposed this PR to focus on fixing resource management in the tests.
   
   Previously, `AbstractOriginTest` had to forcibly close resources in an 
`@AfterAll` method. With the refactoring, tests now:
   
   * Allocate only the resources they actually need (e.g., `originRw` is no 
longer created unnecessarily).
   * Are self-contained: they either close the origin directly (when no 
resource is returned) or use try-with-resources to close the wrapped origin.
   
   This should prevent resource leaks, particularly with `originRw`, which 
often points to a file in a temporary folder. On Windows, if this resource is 
not closed, JUnit 5 will fail to remove the temporary folder.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to