LiAoNan created ZOOKEEPER-4037:
----------------------------------

             Summary: Closing autoCloseable resource with try-with-resources 
block
                 Key: ZOOKEEPER-4037
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4037
             Project: ZooKeeper
          Issue Type: Improvement
            Reporter: LiAoNan


Using


{code:java}
            try (FileInputStream in = new FileInputStream(configFile)) {
                ...
                configFileStr = path;
            }
{code}
replace
{code:java}
            FileInputStream in = new FileInputStream(configFile);
            try {
                ...
            } finally {
                in.close();
            }
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to