You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/03/04 21:34:52 UTC
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1546:
Replace try/finally with try-with-resources.
ctubbsii commented on a change in pull request #1546: Replace try/finally with try-with-resources.
URL: https://github.com/apache/accumulo/pull/1546#discussion_r387942650
##########
File path: core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
##########
@@ -85,16 +85,10 @@ String process(String value) {
justification = "app is run in same security context as user providing the filename")
@Override
String process(String value) {
- Scanner scanner = null;
- try {
- scanner = new Scanner(new File(value), UTF_8);
+ try (Scanner scanner = new Scanner(new File(value), UTF_8)) {
Review comment:
This is a good opportunity to use `var`:
```suggestion
try (var scanner = new Scanner(new File(value), UTF_8)) {
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services