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

CASSANDRA-19647 implemented try-with-resources for Autocloseable #3313

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

dk2k
Copy link
Contributor

@dk2k dk2k commented May 18, 2024

CASSANDRA-19647 implemented try-with-resources for Autocloseable

I'm not introducing this approach. Scroll down class Ballots to line 210 and you'll see preexistng try-with-resources
As for nullability. The Java Language Specification specifies that Autocloseable is closed only if non-null, in section 14.20.3. try-with-resources: A resource is closed only if it initialized to a non-null value. This can actually be useful, when a resource might present sometimes, and absent others.

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