mino181295 opened a new pull request #1529:
URL: https://github.com/apache/zookeeper/pull/1529
```
public void addWatch(String basePath, Watcher watcher, AddWatchMode mode)
throws KeeperException, InterruptedException {
PathUtils.validatePath(basePath);
String serverPath = prependChroot(basePath);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.addWatch);
AddWatchRequest request = new AddWatchRequest(serverPath,
mode.getMode());
ReplyHeader r = cnxn.submitRequest(h, request, new ErrorResponse(),
```
we need to validateWatcher(watcher) to avoid the case:
```
zk.addWatch("/a/b", null, PERSISTENT_RECURSIVE);
```
----------------------------------------------------------------
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:
[email protected]