You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/12/25 06:14:00 UTC

[jira] [Updated] (ZOOKEEPER-4037) Closing autoCloseable resource with try-with-resources block

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-4037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ZOOKEEPER-4037:
--------------------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)