[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15805994#comment-15805994
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2511:
-------------------------------------------

Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/143#discussion_r95032230
  
    --- Diff: src/java/main/org/apache/zookeeper/ZooKeeper.java ---
    @@ -127,7 +127,13 @@
      * EventNone and state sKeeperStateDisconnected.
      *
      */
    -public class ZooKeeper {
    +// We suppress the "try" warning here because the close() method's 
signature
    --- End diff --
    
    Good point on avoiding mixing implementation comments with end user facing 
documents. Though in this case it is safe to use block comments as @eribeiro 
pointed out because block comments (enclosed in '/* */') will not be part of 
java doc (enclosed in '/** */'), also use block comments provide better visual 
consistency style with reset of multi line comments in src file.
    
    It might also be helpful to add to Java doc on ZooKeeper.close so user 
aware that since 3.5.3 they could optionally use try-with-resource on ZooKeeper 
object without explicitly invoking close method.


> Implement AutoCloseable in ZooKeeper.java
> -----------------------------------------
>
>                 Key: ZOOKEEPER-2511
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2511
>             Project: ZooKeeper
>          Issue Type: Improvement
>            Reporter: Abraham Fine
>            Assignee: Abraham Fine
>             Fix For: 3.5.3
>
>         Attachments: ZOOKEEPER-2511.patch
>
>
> As a java developer I would like to be able to use try-with-resource blocks 
> with ZooKeeper objects in order to make closing sessions easier.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to