You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/10/15 13:30:38 UTC

[GitHub] [zookeeper] TisonKun commented on issue #1120: ZOOKEEPER-3579: Initialize defaultWatcher as dummy watcher to prevent it from NPE

TisonKun commented on issue #1120: ZOOKEEPER-3579: Initialize defaultWatcher as dummy watcher to prevent it from NPE
URL: https://github.com/apache/zookeeper/pull/1120#issuecomment-542212460
 
 
   Although the solution in https://github.com/apache/zookeeper/pull/1119/files can also resolve this issue since in other case we exclude null defaultWatcher like in `exists`
   
   ```java
   // the watch contains the un-chroot path
           WatchRegistration wcb = null;
           if (watcher != null) {
               wcb = new ExistsWatchRegistration(watcher, clientPath);
           }
   ```
   
   this pull request follows a self-reasoned style that we ensure we never process a null defaultWatcher. Although it introduces a dummy process cycle I don't think it matters too much.

----------------------------------------------------------------
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