Skip to content

Use try-with-resources in AbstractTransporter#1947

Open
Aayush10016 wants to merge 1 commit into
apache:masterfrom
Aayush10016:use-try-with-resources-abstract-transporter
Open

Use try-with-resources in AbstractTransporter#1947
Aayush10016 wants to merge 1 commit into
apache:masterfrom
Aayush10016:use-try-with-resources-abstract-transporter

Conversation

@Aayush10016

Copy link
Copy Markdown

Summary

  • Refactor AbstractTransporter stream handling to use try-with-resources for the close-on-completion paths.
  • Preserve the existing close=false behavior by leaving download input streams open and flushing upload output streams.
  • Add focused tests for the utilGet and utilPut close/flush contracts.

Closes #1521.

Verification

  • mvn -pl maven-resolver-spi -am test with Temurin JDK 21.0.11

Refactor stream handling in utilGet and utilPut while preserving the existing close and flush contracts. Add tests for the close=false and close=true paths.

Closes apache#1521

Generated-by: Codex
@cstamas

cstamas commented Jul 6, 2026

Copy link
Copy Markdown
Member

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.

Use try-with-resources

2 participants