Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close HTTPClient when running with JDK21 or newer #70

Merged
merged 2 commits into from
Nov 26, 2023

Conversation

stklcode
Copy link
Owner

The Java HTTP client implements AutoCloseable since JDK 21. Closing the client ensures that asynchronous operations and streams are properly terminated.

As we support Java 11, we add any old school finally wrapper and conditionally close the client when running on a modern platform.

The Java HTTP client implements AutoCloseable since JDK 21. Closing the
client ensures that asynchronous operations and streams are properly
terminated.

As we support Java 11, we add any old school "finally" wrapper and
conditionally close the client when running on a modern platform.
@stklcode stklcode added this to the 1.2 milestone Nov 26, 2023
@stklcode stklcode self-assigned this Nov 26, 2023
The JDK 21 build with Vault 1.11 seems to be the only job with full
coverage on conditional code.
@stklcode stklcode closed this Nov 26, 2023
@stklcode stklcode deleted the feature/close-httpclient branch November 26, 2023 10:39
@stklcode stklcode restored the feature/close-httpclient branch November 26, 2023 10:40
@stklcode stklcode reopened this Nov 26, 2023
@stklcode stklcode merged commit 56d5345 into develop Nov 26, 2023
37 checks passed
@stklcode stklcode deleted the feature/close-httpclient branch November 26, 2023 10:41
@stklcode stklcode changed the title close HTTPClient when running with JDK21 or newer (#70) close HTTPClient when running with JDK21 or newer Nov 26, 2023
Copy link

sonarcloud bot commented Nov 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

66.7% 66.7% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant