maoling created ZOOKEEPER-3992:
----------------------------------
Summary: addWatch api should check the null watch
Key: ZOOKEEPER-3992
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3992
Project: ZooKeeper
Issue Type: Bug
Components: java client
Reporter: maoling
Fix For: 3.7.0
{code:java}
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(),
{code}
we need to _*validateWatcher(watcher)*_ to ** avoid the case:
{code:java}
zk.addWatch("/a/b", null, PERSISTENT_RECURSIVE);
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)