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

Use try-with when opening resources #4

Closed
ricardoekm opened this issue Dec 2, 2019 · 1 comment
Closed

Use try-with when opening resources #4

ricardoekm opened this issue Dec 2, 2019 · 1 comment
Labels

Comments

@ricardoekm
Copy link
Owner

ricardoekm commented Dec 2, 2019

It's recommended to use try-with when opening resources to avoid resource leakage.

BufferedReader br = new BufferedReader(new FileReader(Config.configFileName));
String line;
List<String> inputStrings = new ArrayList<>();
while ((line = br.readLine()) != null) inputStrings.add(line);

@tracyhenry
Copy link

also tracked here: tracyhenry#15
and an initial impl: tracyhenry#133

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

No branches or pull requests

2 participants