-
Notifications
You must be signed in to change notification settings - Fork 646
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueIssues for first-time contributorsIssues for first-time contributors
Description
Search before asking
- I had searched in the issues and found no similar issues.
Enhancement Request
Lines 138 to 145 in ee9ee4c
| } finally { | |
| if (out != null) { | |
| try { | |
| out.close(); | |
| } catch (IOException e) { | |
| log.warn("out close failed...", e); | |
| } | |
| } |
analysis and explanation:
This method allocates and uses an auto closeable resource. However, it manually closes the resource in a finally block. While this is correct management, it doesn't rely on the idiomatic way available to JDK 7 and above, allows for possible subtle problems, and complicates the reading of code by developers expecting the use of try-with-resources.
Describe the solution you'd like
Change to use try-with-resources to manage resources.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueIssues for first-time contributorsIssues for first-time contributors