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

maoling commented on ZOOKEEPER-3926:
------------------------------------

[~Suraj Naik] Of course, please pick it up and go ahead:)

> make the rc constant in the ClientCnxn
> --------------------------------------
>
>                 Key: ZOOKEEPER-3926
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3926
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: maoling
>            Priority: Minor
>
> Lots of codes about the result code in the 
> callback(ClientCnxn.EventThread#processEvent) is hardcode. For example:
> {code:java}
> } else if (p.response instanceof GetACLResponse) {
>     ACLCallback cb = (ACLCallback) p.cb;
>     GetACLResponse rsp = (GetACLResponse) p.response;
>     if (rc == 0) {
>         cb.processResult(rc, clientPath, p.ctx, rsp.getAcl(), rsp.getStat());
>     } else {
>         cb.processResult(rc, clientPath, p.ctx, null, null);
>     }
> }{code}
> This makes the codes difficult to maintain. What we want looks like this:
> {code:java}
> if (rc == Code.OK.intValue()) {
>    ////////////////////////
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to