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

Replace consecutive close() calls and close() calls with null checks with IOUtils.close() #12428

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

shubhamvishu
Copy link
Contributor

@shubhamvishu shubhamvishu commented Jul 10, 2023

Description

This PR replaces :

  • The consecutive close() calls with IOUtils.close() to close multiple Closeables'
  • The close() calls with null checks with IOUtils.close()

Tests

./gradlew check

Copy link
Contributor

@stefanvodita stefanvodita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change makes sense, thank you for tackling it.

@gsmiller
Copy link
Contributor

LGTM as well. Thanks @shubhamvishu!

@gsmiller
Copy link
Contributor

gsmiller commented Aug 9, 2023

@shubhamvishu apologies. I realized I marked this approved but never merged it. I'm happy to help merge this change, but would you mind adding a small note in CHANGES?

@shubhamvishu
Copy link
Contributor Author

@gsmiller I have added the CHANGES entry under 9.8.0 and replaced a couple of more such calls I could find. Let me know if this looks good. Thanks!

@gsmiller gsmiller merged commit 368dbff into apache:main Aug 17, 2023
4 checks passed
gsmiller pushed a commit that referenced this pull request Aug 17, 2023
@gsmiller
Copy link
Contributor

Merged and back-ported. Thanks @shubhamvishu !

@gsmiller gsmiller added this to the 9.8.0 milestone Aug 17, 2023
@madrob
Copy link
Contributor

madrob commented Aug 17, 2023

I would be curious to see the impact on performance here

@shubhamvishu
Copy link
Contributor Author

@madrob I don't think this change would be performance impacting as such though.

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.

None yet

4 participants