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

do not remove try block if there are resources #161

Merged
merged 5 commits into from
Aug 24, 2023

Conversation

joanvr
Copy link
Contributor

@joanvr joanvr commented Aug 24, 2023

What's changed?

Try with resources can have side effects (closing the streams) even with empty try blocks. So we cannot delete it safely.

Modified the emptyTry test to not have resources (so it's removed because it's empty), and added a new emptyTryWithResources that is actually not removed because it has resources.

Anyone you would like to review specifically?

@kmccarp

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've added the license header to any new files through ./gradlew licenseFormat
  • I've used the IntelliJ IDEA auto-formatter on affected files
  • I've updated the documentation (if applicable)

@joanvr joanvr requested a review from kmccarp August 24, 2023 13:46
@sambsnyd sambsnyd merged commit 31491f3 into main Aug 24, 2023
1 check passed
@sambsnyd sambsnyd deleted the bug/removed-try-with-non-empty-resources branch August 24, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants